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

@ -47,7 +47,7 @@ func (a *App) SimklLogin() {
scope, err := simklRing.Get("SimklScope")
if err != nil || len(accessToken.Data) == 0 {
getSimklCodeUrl := "https://simkl.com/oauth/authorize?response_type=code&client_id=" + Environment.SIMKL_CLIENT_ID + "&redirect_uri=" + Environment.SIMKL_CALLBACK_URI
runtime.BrowserOpenURL(a.ctx, getSimklCodeUrl)
runtime.BrowserOpenURL(*wailsContext, getSimklCodeUrl)
serverDone := &sync.WaitGroup{}
serverDone.Add(1)
@ -87,7 +87,7 @@ func (a *App) handleSimklCallback(wg *sync.WaitGroup) {
Key: "SimklScope",
Data: []byte(simklJwt.Scope),
})
_, err := runtime.MessageDialog(a.ctx, runtime.MessageDialogOptions{
_, err := runtime.MessageDialog(*wailsContext, runtime.MessageDialogOptions{
Title: "Simkl Authorization",
Message: "It is now safe to close your browser tab",
})