summaryrefslogtreecommitdiff
path: root/ui/ui.go
diff options
context:
space:
mode:
authorHubert Hirtz <hubert@hirtz.pm>2021-01-07 12:17:31 +0100
committerHubert Hirtz <hubert@hirtz.pm>2021-01-07 12:17:31 +0100
commit511a95bef3656966098aa49eebe9427e9b43a935 (patch)
treeb961b3c8643882ddc06605877af7d2ed6f409e2a /ui/ui.go
parentChathistory: don't send invalid timestamps (diff)
Fix random crash on startup
The .exit value would be read before it was initialized.
Diffstat (limited to 'ui/ui.go')
-rw-r--r--ui/ui.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/ui.go b/ui/ui.go
index 5a30cb1..7eb6083 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -46,6 +46,8 @@ func New(config Config) (ui *UI, err error) {
ui.screen.Clear()
ui.screen.ShowCursor(0, h-2)
+ ui.exit.Store(false)
+
ui.Events = make(chan tcell.Event, 128)
go func() {
for !ui.ShouldExit() {
@@ -53,8 +55,6 @@ func New(config Config) (ui *UI, err error) {
}
}()
- ui.exit.Store(false)
-
ui.bs = NewBufferList(w, h, ui.config.NickColWidth)
ui.e = NewEditor(w, ui.config.AutoComplete)
ui.Resize()