MCPcopy Index your code
hub / github.com/anomalyco/opencode / togglePin

Function togglePin

packages/tui/src/context/local.tsx:484–493  ·  view source on GitHub ↗
(sessionID: string)

Source from the content-addressed store, hash-verified

482 return sessionStore.pinned.includes(sessionID)
483 },
484 togglePin(sessionID: string) {
485 batch(() => {
486 const exists = sessionStore.pinned.includes(sessionID)
487 const next = exists
488 ? sessionStore.pinned.filter((x) => x !== sessionID)
489 : [...sessionStore.pinned, sessionID]
490 setSessionStore("pinned", next)
491 save()
492 })
493 },
494 quickSwitch(slot: number) {
495 const target = slots()[slot - 1]
496 if (!target) return

Callers

nothing calls this directly

Calls 2

batchFunction · 0.85
saveFunction · 0.70

Tested by

no test coverage detected