From 2035664463ef4aefca5a772e6a4f95cf327f6f15 Mon Sep 17 00:00:00 2001 From: matryer Date: Thu, 18 Mar 2021 12:27:41 +0000 Subject: [PATCH] wait before checking for updates #646 --- app/app.go | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/app/app.go b/app/app.go index 619a260cc..29cd6f52a 100644 --- a/app/app.go +++ b/app/app.go @@ -134,7 +134,11 @@ func (app *app) Start(runtime *wails.Runtime) { log.Println("failed to create plugin directory:", err) } app.RefreshAll() - go app.checkForUpdates(true) + go func() { + // wait before checking for updates + time.Sleep(10 * time.Second) + app.checkForUpdates(true) + }() } func (app *app) RefreshAll() { @@ -508,19 +512,6 @@ func (app *app) updateLabel(tray *menu.TrayMenu, p *plugins.Plugin) bool { // downloads it and installs it. // If passive is true, it won't complain if it fails. func (app *app) checkForUpdates(passive bool) { - if version == "dev" { - log.Println("dev: skipping update check") - if !passive { - app.runtime.Dialog.Message(&dialog.MessageDialog{ - Type: dialog.ErrorDialog, - Title: "Update check failed", - Message: "Cannot check for updates with a dev build. Build for production and try again.", - Buttons: []string{"OK"}, - CancelButton: "OK", - }) - } - return - } u := update.Updater{ CurrentVersion: version, //LatestReleaseGitHubEndpoint: "https://api.github.com/repos/matryer/xbar/releases/latest",