app now only allows a single instance

This commit is contained in:
2024-09-07 22:35:51 -04:00
parent 908325628f
commit 45b11fa8f4
5 changed files with 26 additions and 7 deletions

View File

@ -52,7 +52,7 @@ func (a *App) AniListLogin() {
refreshToken, err := aniRing.Get("anilistRefreshToken")
if err != nil || len(accessToken.Data) == 0 {
getAniListCodeUrl := "https://anilist.co/api/v2/oauth/authorize?client_id=" + Environment.ANILIST_APP_ID + "&redirect_uri=" + Environment.ANILIST_CALLBACK_URI + "&response_type=code"
runtime.BrowserOpenURL(a.ctx, getAniListCodeUrl)
runtime.BrowserOpenURL(*wailsContext, getAniListCodeUrl)
serverDone := &sync.WaitGroup{}
serverDone.Add(1)
@ -97,7 +97,7 @@ func (a *App) handleAniListCallback(wg *sync.WaitGroup) {
Key: "anilistRefreshToken",
Data: []byte(aniListJwt.RefreshToken),
})
_, err := runtime.MessageDialog(a.ctx, runtime.MessageDialogOptions{
_, err := runtime.MessageDialog(*wailsContext, runtime.MessageDialogOptions{
Title: "AniList Authorization",
Message: "It is now safe to close your browser tab",
})