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

Function removeView

packages/app-core/src/lib/database-cells.ts:252–257  ·  view source on GitHub ↗
(doc: DatabaseDoc, viewId: string)

Source from the content-addressed store, hash-verified

250}
251
252export function removeView(doc: DatabaseDoc, viewId: string): DatabaseDoc {
253 if (doc.views.length <= 1) return doc // keep at least one view
254 const views = doc.views.filter((v) => v.id !== viewId)
255 const activeViewId = doc.activeViewId === viewId ? views[0].id : doc.activeViewId
256 return { ...doc, views, activeViewId }
257}
258
259export function addView(doc: DatabaseDoc, type: 'table' | 'board'): DatabaseDoc {
260 const id = genId()

Callers 1

viewMenuItemsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected