fix(app): fix flicker and navigation when collapsing/expanding projects (#6658)
This commit is contained in:
parent
8e9a0c4ad0
commit
bbd1c071c4
4 changed files with 12 additions and 15 deletions
|
|
@ -6,6 +6,7 @@ import { useGlobalSDK } from "./global-sdk"
|
|||
import { useServer } from "./server"
|
||||
import { Project } from "@opencode-ai/sdk/v2"
|
||||
import { persisted } from "@/utils/persist"
|
||||
import { same } from "@/utils/same"
|
||||
|
||||
const AVATAR_COLOR_KEYS = ["pink", "mint", "orange", "purple", "cyan", "lime"] as const
|
||||
export type AvatarColorKey = (typeof AVATAR_COLOR_KEYS)[number]
|
||||
|
|
@ -23,13 +24,6 @@ export function getAvatarColors(key?: string) {
|
|||
}
|
||||
}
|
||||
|
||||
function same<T>(a: readonly T[] | undefined, b: readonly T[] | undefined) {
|
||||
if (a === b) return true
|
||||
if (!a || !b) return false
|
||||
if (a.length !== b.length) return false
|
||||
return a.every((x, i) => x === b[i])
|
||||
}
|
||||
|
||||
type SessionTabs = {
|
||||
active?: string
|
||||
all: string[]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue