summaryrefslogtreecommitdiffstats
path: root/pkg/gui/updates.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-23 12:20:49 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commit94601b4dc951de9b1efa08120148d2d9766b637c (patch)
tree0541d8468d78a58f4a2ef069323de475be13d29c /pkg/gui/updates.go
parent9ca0073cd7680d2417d4bb0a38a7b02df3dfd651 (diff)
use context to return to the correct view
Diffstat (limited to 'pkg/gui/updates.go')
-rw-r--r--pkg/gui/updates.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/pkg/gui/updates.go b/pkg/gui/updates.go
index 759287b82..b121e537d 100644
--- a/pkg/gui/updates.go
+++ b/pkg/gui/updates.go
@@ -2,14 +2,11 @@ package gui
import "github.com/jesseduffield/gocui"
-func (gui *Gui) showUpdatePrompt(newVersion string) error {
- currentView := gui.g.CurrentView()
+func (gui *Gui) showUpdatePrompt(newVersion string) error {
return gui.ask(askOpts{
- returnToView: currentView,
- returnFocusOnClose: true,
- title: "New version available!",
- prompt: "Download latest version? (enter/esc)",
+ title: "New version available!",
+ prompt: "Download latest version? (enter/esc)",
handleConfirm: func() error {
gui.startUpdating(newVersion)
return nil
@@ -61,10 +58,8 @@ func (gui *Gui) onUpdateFinish(err error) error {
func (gui *Gui) createUpdateQuitConfirmation() error {
return gui.ask(askOpts{
- returnToView: gui.g.CurrentView(),
- returnFocusOnClose: true,
- title: "Currently Updating",
- prompt: "An update is in progress. Are you sure you want to quit?",
+ title: "Currently Updating",
+ prompt: "An update is in progress. Are you sure you want to quit?",
handleConfirm: func() error {
return gocui.ErrQuit
},