From: Jeff Halter Date: Wed, 4 Aug 2021 03:32:41 +0000 (-0700) Subject: Fix error message on logout X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/commitdiff_plain/06e9400384f1d3a8d13006e70fd34532fcbfc59f?ds=sidebyside;hp=5c34f8752938764668d829fb284626b9c62c5475 Fix error message on logout --- diff --git a/hotline/ui.go b/hotline/ui.go index de6ec82..406c88f 100644 --- a/hotline/ui.go +++ b/hotline/ui.go @@ -209,18 +209,20 @@ func (ui *UI) joinServer(addr, login, password string) error { msg := err.Error() if err == io.EOF { msg = "The server connection has unexpectedly closed." + loginErrModal := tview.NewModal(). + AddButtons([]string{"Ok"}). + SetText(msg). + SetDoneFunc(func(buttonIndex int, buttonLabel string) { + ui.Pages.SwitchToPage("home") + }) + loginErrModal.Box.SetTitle("Server Connection Error") + + ui.Pages.AddPage("loginErr", loginErrModal, false, true) + ui.App.Draw() + return } + ui.Pages.SwitchToPage("home") - loginErrModal := tview.NewModal(). - AddButtons([]string{"Ok"}). - SetText(msg). - SetDoneFunc(func(buttonIndex int, buttonLabel string) { - ui.Pages.SwitchToPage("home") - }) - loginErrModal.Box.SetTitle("Server Connection Error") - - ui.Pages.AddPage("loginErr", loginErrModal, false, true) - ui.App.Draw() return } }