diff options
| author | Adam <[email protected]> | 2025-09-24 15:46:33 -0500 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-09-24 15:46:33 -0500 |
| commit | c3e52580b000d9f8e51a6768226d99e113164bbd (patch) | |
| tree | 0f9512b6c8266b68325ad3bef2cd38b5cc14bfb0 /packages/app/src/context | |
| parent | 2badfcdcf4ca176d389c70d4eab0eb7b30b2b331 (diff) | |
| download | opencode-c3e52580b000d9f8e51a6768226d99e113164bbd.tar.gz opencode-c3e52580b000d9f8e51a6768226d99e113164bbd.zip | |
feat(app): changes view
Diffstat (limited to 'packages/app/src/context')
| -rw-r--r-- | packages/app/src/context/local.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/app/src/context/local.tsx b/packages/app/src/context/local.tsx index c74ae21ab..804bb0674 100644 --- a/packages/app/src/context/local.tsx +++ b/packages/app/src/context/local.tsx @@ -163,7 +163,7 @@ function init() { }) } - const open = async (path: string, options?: { pin?: boolean }) => { + const open = async (path: string, options?: { pinned?: boolean; view?: LocalFile["view"] }) => { const relative = path.replace(sync.data.path.directory + "/", "") if (!store.node[relative]) { const parent = relative.split("/").slice(0, -1).join("/") @@ -181,7 +181,8 @@ function init() { ] }) setStore("active", relative) - if (options?.pin) setStore("node", path, "pinned", true) + if (options?.pinned) setStore("node", path, "pinned", true) + if (options?.view && store.node[relative].view === undefined) setStore("node", path, "view", options.view) if (store.node[relative].loaded) return return load(relative) } @@ -297,6 +298,7 @@ function init() { setStore("node", path, "selectedChange", index) }, changed, + changes, status, children(path: string) { return Object.values(store.node).filter( |
