chore: generate
This commit is contained in:
@@ -65,7 +65,13 @@ import { Titlebar } from "@/components/titlebar"
|
|||||||
import { useServer } from "@/context/server"
|
import { useServer } from "@/context/server"
|
||||||
import { useLanguage, type Locale } from "@/context/language"
|
import { useLanguage, type Locale } from "@/context/language"
|
||||||
import { pathKey } from "@/utils/path-key"
|
import { pathKey } from "@/utils/path-key"
|
||||||
import { displayName, effectiveWorkspaceOrder, errorMessage, latestRootSession, sortedRootSessions } from "./layout/helpers"
|
import {
|
||||||
|
displayName,
|
||||||
|
effectiveWorkspaceOrder,
|
||||||
|
errorMessage,
|
||||||
|
latestRootSession,
|
||||||
|
sortedRootSessions,
|
||||||
|
} from "./layout/helpers"
|
||||||
import {
|
import {
|
||||||
collectNewSessionDeepLinks,
|
collectNewSessionDeepLinks,
|
||||||
collectOpenProjectDeepLinks,
|
collectOpenProjectDeepLinks,
|
||||||
@@ -640,8 +646,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
if (!expanded) continue
|
if (!expanded) continue
|
||||||
const key = pathKey(directory)
|
const key = pathKey(directory)
|
||||||
const project = projects.find(
|
const project = projects.find(
|
||||||
(item) =>
|
(item) => pathKey(item.worktree) === key || item.sandboxes?.some((sandbox) => pathKey(sandbox) === key),
|
||||||
pathKey(item.worktree) === key || item.sandboxes?.some((sandbox) => pathKey(sandbox) === key),
|
|
||||||
)
|
)
|
||||||
if (!project) continue
|
if (!project) continue
|
||||||
if (project.vcs === "git" && layout.sidebar.workspaces(project.worktree)()) continue
|
if (project.vcs === "git" && layout.sidebar.workspaces(project.worktree)()) continue
|
||||||
@@ -1218,10 +1223,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
const key = pathKey(directory)
|
const key = pathKey(directory)
|
||||||
const project = layout.projects
|
const project = layout.projects
|
||||||
.list()
|
.list()
|
||||||
.find(
|
.find((item) => pathKey(item.worktree) === key || item.sandboxes?.some((sandbox) => pathKey(sandbox) === key))
|
||||||
(item) =>
|
|
||||||
pathKey(item.worktree) === key || item.sandboxes?.some((sandbox) => pathKey(sandbox) === key),
|
|
||||||
)
|
|
||||||
if (project) return project.worktree
|
if (project) return project.worktree
|
||||||
|
|
||||||
const known = Object.entries(store.workspaceOrder).find(
|
const known = Object.entries(store.workspaceOrder).find(
|
||||||
@@ -1634,7 +1636,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const handleDelete = () => {
|
const handleDelete = () => {
|
||||||
const leaveDeletedWorkspace = !!params.dir && pathKey(currentDir()) === pathKey(props.directory)
|
const leaveDeletedWorkspace = !!params.dir && pathKey(currentDir()) === pathKey(props.directory)
|
||||||
if (leaveDeletedWorkspace) {
|
if (leaveDeletedWorkspace) {
|
||||||
navigateWithSidebarReset(`/${base64Encode(props.root)}/session`)
|
navigateWithSidebarReset(`/${base64Encode(props.root)}/session`)
|
||||||
}
|
}
|
||||||
@@ -1863,9 +1865,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
const active = currentProject()
|
const active = currentProject()
|
||||||
const directory = pathKey(active?.worktree ?? "") === pathKey(project.worktree) ? currentDir() : undefined
|
const directory = pathKey(active?.worktree ?? "") === pathKey(project.worktree) ? currentDir() : undefined
|
||||||
const extra =
|
const extra =
|
||||||
directory &&
|
directory && pathKey(directory) !== pathKey(local) && !dirs.some((item) => pathKey(item) === pathKey(directory))
|
||||||
pathKey(directory) !== pathKey(local) &&
|
|
||||||
!dirs.some((item) => pathKey(item) === pathKey(directory))
|
|
||||||
? directory
|
? directory
|
||||||
: undefined
|
: undefined
|
||||||
const pending = extra ? WorktreeState.get(extra)?.status === "pending" : false
|
const pending = extra ? WorktreeState.get(extra)?.status === "pending" : false
|
||||||
|
|||||||
@@ -475,7 +475,10 @@ export const Persist = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export function removePersisted(target: { storage?: string; legacyStorageNames?: string[]; key: string }, platform?: Platform) {
|
export function removePersisted(
|
||||||
|
target: { storage?: string; legacyStorageNames?: string[]; key: string },
|
||||||
|
platform?: Platform,
|
||||||
|
) {
|
||||||
const isDesktop = platform?.platform === "desktop" && !!platform.storage
|
const isDesktop = platform?.platform === "desktop" && !!platform.storage
|
||||||
|
|
||||||
if (isDesktop) {
|
if (isDesktop) {
|
||||||
@@ -556,7 +559,9 @@ export function persisted<T>(
|
|||||||
|
|
||||||
const current = currentStorage as AsyncStorage
|
const current = currentStorage as AsyncStorage
|
||||||
const legacyStore = legacyStorage as AsyncStorage | undefined
|
const legacyStore = legacyStorage as AsyncStorage | undefined
|
||||||
const legacyStores = legacyStorageNames.map((name) => platform.storage?.(name) as AsyncStorage | undefined).filter((x) => !!x)
|
const legacyStores = legacyStorageNames
|
||||||
|
.map((name) => platform.storage?.(name) as AsyncStorage | undefined)
|
||||||
|
.filter((x) => !!x)
|
||||||
|
|
||||||
const api: AsyncStorage = {
|
const api: AsyncStorage = {
|
||||||
getItem: async (key) => {
|
getItem: async (key) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user