MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / isTasksViewActive

Function isTasksViewActive

packages/app-core/src/store.ts:1808–1814  ·  view source on GitHub ↗
(state: {
  paneLayout: PaneLayout
  activePaneId: string
})

Source from the content-addressed store, hash-verified

1806 * panel lives as a tab in the pane layout, so this is how callers detect
1807 * "user is on the Tasks view" (there's no `view.kind === 'tasks'`). */
1808export function isTasksViewActive(state: {
1809 paneLayout: PaneLayout
1810 activePaneId: string
1811}): boolean {
1812 const leaf = findLeaf(state.paneLayout, state.activePaneId)
1813 return leaf?.activeTab === TASKS_TAB_PATH
1814}
1815
1816function hasTasksViewOpen(state: { paneLayout: PaneLayout }): boolean {
1817 return allLeaves(state.paneLayout).some((leaf) => leaf.tabs.includes(TASKS_TAB_PATH))

Callers 4

registerVimCommandsFunction · 0.90
closeActiveTabLikeQuitFunction · 0.90
handlerFunction · 0.90
buildCommandsFunction · 0.90

Calls 1

findLeafFunction · 0.90

Tested by

no test coverage detected