diff --git a/pkg/ui/github_repo_view.go b/pkg/ui/github_repo_view.go index 23e627b..f78a4d8 100644 --- a/pkg/ui/github_repo_view.go +++ b/pkg/ui/github_repo_view.go @@ -129,7 +129,7 @@ func (g *githubRepoView) init() { go func() { wv := getWorkspacesView() tv := getTopicsView() - refreshFsAsync() + refreshMainViews() getMainTabGroup().FocusTabByIndex(0) wv.focus() tv.selectTopicByName(a.Topic.Name) diff --git a/pkg/ui/tmux_pane_view.go b/pkg/ui/tmux_pane_view.go index a1e53bd..b1f8ead 100644 --- a/pkg/ui/tmux_pane_view.go +++ b/pkg/ui/tmux_pane_view.go @@ -79,7 +79,7 @@ func (t *tmuxPaneView) init() { openToastDialogError(err.Error()) } - refreshTmuxViewsAsync() + refreshTmuxViews() }, "Are you sure you want to kill this pane?") }). Set(gocui.KeyEsc, "Focus window view", func() { diff --git a/pkg/ui/tmux_session_view.go b/pkg/ui/tmux_session_view.go index 4589fce..46a45d6 100644 --- a/pkg/ui/tmux_session_view.go +++ b/pkg/ui/tmux_session_view.go @@ -95,8 +95,8 @@ func (tv *tmuxSessionView) init() { return } - refreshTmuxViewsAsync() - + refreshTmuxViews() + refreshMainViews() } }, "Are you sure you want to delete this session?") }). @@ -112,8 +112,8 @@ func (tv *tmuxSessionView) init() { return } - refreshTmuxViewsAsync() - refreshFsAsync() + refreshTmuxViews() + refreshMainViews() } }, "Are you sure you want to delete ALL tmux sessions?") }). @@ -129,8 +129,8 @@ func (tv *tmuxSessionView) init() { return } - refreshTmuxViewsAsync() - refreshFsAsync() + refreshTmuxViews() + refreshMainViews() } }, "Are you sure you want to delete ALL non-external tmux sessions?") }). @@ -208,7 +208,7 @@ func (ts *tmuxSessionView) refresh() { ts.tableRenderer.FillTable(rows, sessions) } -func refreshTmuxViewsAsync() { +func refreshTmuxViews() { go func() { ts := getTmuxSessionView() ts.refresh() diff --git a/pkg/ui/tmux_window_view.go b/pkg/ui/tmux_window_view.go index 2e2e38a..2cc7dab 100644 --- a/pkg/ui/tmux_window_view.go +++ b/pkg/ui/tmux_window_view.go @@ -115,7 +115,7 @@ func (t *tmuxWindowView) init() { openToastDialogError(err.Error()) } - refreshTmuxViewsAsync() + refreshTmuxViews() }, "Are you sure you want to kill this window?") }). Set(gocui.KeyEsc, "Focus session view", func() { diff --git a/pkg/ui/topic_view.go b/pkg/ui/topic_view.go index 1dfd17d..085309b 100644 --- a/pkg/ui/topic_view.go +++ b/pkg/ui/topic_view.go @@ -80,14 +80,14 @@ func (tv *topicsView) init() { openEditorDialog(func(s string) { tv.search.Set(s) tv.view.Subtitle = tui.WithSurroundingSpaces("Searching: " + s) - refreshFsAsync() + refreshMainViews() }, func() {}, "Search", smallEditorSize) }). Set(gocui.KeyEsc, "Escape search", func() { if tv.search.Get() != "" { tv.search.Set("") tv.view.Subtitle = "" - refreshFsAsync() + refreshMainViews() } }). Set('a', "Create a topic", func() { @@ -101,7 +101,7 @@ func (tv *topicsView) init() { // This will result in the corresponding topic going to the top // because we are sorting by modifed time tv.tableRenderer.SelectRow(0) - refreshFsAsync() + refreshMainViews() }, func() {}, "Topic name", smallEditorSize) }). Set('r', "Rename topic", func() { @@ -116,7 +116,7 @@ func (tv *topicsView) init() { return } - refreshFsAsync() + refreshMainViews() }, func() {}, "New topic name", smallEditorSize, t.Name) }). Set('s', "Search for a workspace", func() { @@ -171,7 +171,7 @@ func (tv *topicsView) init() { openToastDialogError(err.Error()) } - refreshFsAsync() + refreshMainViews() }, "Are you sure you want to delete this topic? All its content will be deleted.") }). Set('?', "Toggle cheatsheet", func() { @@ -200,7 +200,7 @@ func (tv *topicsView) refresh() { tv.tableRenderer.FillTable(rows, rowValues) } -func refreshFsAsync() { +func refreshMainViews() { if !getApi().GlobalConfiguration.Standalone { go func() { t := getTopicsView() diff --git a/pkg/ui/ui.go b/pkg/ui/ui.go index bf0d1cd..651785a 100644 --- a/pkg/ui/ui.go +++ b/pkg/ui/ui.go @@ -171,6 +171,6 @@ func runAction(f func()) { tui.Suspend() f() tui.Resume() - refreshFsAsync() - refreshTmuxViewsAsync() + refreshMainViews() + refreshTmuxViews() } diff --git a/pkg/ui/workspace_view.go b/pkg/ui/workspace_view.go index ff47c96..1dc61d9 100644 --- a/pkg/ui/workspace_view.go +++ b/pkg/ui/workspace_view.go @@ -127,7 +127,7 @@ func (wv *workspacesView) init() { openToastDialogError(err.Error()) } - refreshFsAsync() + refreshMainViews() }, func() {}, "Git repo URL", smallEditorSize) }). Set('G', "Open browser to git repo", func() { @@ -272,7 +272,7 @@ func (wv *workspacesView) init() { } tv.tableRenderer.SelectRow(0) - refreshFsAsync() + refreshMainViews() wv.focus() }, onSelectDescription: "Move workspace to this topic", @@ -299,8 +299,8 @@ func (wv *workspacesView) init() { // HACK: same as below tv.tableRenderer.SelectRow(0) - refreshFsAsync() - refreshTmuxViewsAsync() + refreshMainViews() + refreshTmuxViews() } }, "Are you sure you want to delete this workspace?") }). @@ -318,8 +318,8 @@ func (wv *workspacesView) init() { tv.tableRenderer.SelectRow(0) wv.tableRenderer.SelectRow(0) - refreshTmuxViewsAsync() - refreshFsAsync() + refreshTmuxViews() + refreshMainViews() }, func() {}, "New workspace name", smallEditorSize, curWorkspace.Name) }). Set('e', "Add/change description", func() { @@ -331,7 +331,7 @@ func (wv *workspacesView) init() { openEditorDialog(func(desc string) { if desc != "" { getApi().Core.SetDescription(desc, curWorkspace) - refreshFsAsync() + refreshMainViews() } }, func() {}, "Description", largeEditorSize) }). @@ -353,7 +353,7 @@ func (wv *workspacesView) init() { // because we are sorting by modifed time tv.tableRenderer.SelectRow(0) wv.tableRenderer.SelectRow(0) - refreshFsAsync() + refreshMainViews() }, func() {}, "Workspace name ", smallEditorSize) }). Set('X', "Kill tmux session", func() { @@ -366,7 +366,8 @@ func (wv *workspacesView) init() { openConfirmationDialog(func(b bool) { if b { getApi().Core.DeleteWorkspaceTmuxSession(curWorkspace) - refreshFsAsync() + refreshMainViews() + refreshTmuxViews() } }, "Are you sure you want to delete the tmux session?") }