summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/utils
diff options
context:
space:
mode:
authorAlbin Groen <[email protected]>2026-01-05 18:24:49 +0100
committerGitHub <[email protected]>2026-01-05 11:24:49 -0600
commitbbd1c071c4f3258cc2612f20a7ba306ac730060a (patch)
tree6a2047b1016278404cce36c7d4bf028fbf3a7292 /packages/app/src/utils
parent8e9a0c4ad014eb54d7ddd8de3b5f321de931f2f7 (diff)
downloadopencode-bbd1c071c4f3258cc2612f20a7ba306ac730060a.tar.gz
opencode-bbd1c071c4f3258cc2612f20a7ba306ac730060a.zip
fix(app): fix flicker and navigation when collapsing/expanding projects (#6658)
Diffstat (limited to 'packages/app/src/utils')
-rw-r--r--packages/app/src/utils/same.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/app/src/utils/same.ts b/packages/app/src/utils/same.ts
new file mode 100644
index 000000000..c956f9299
--- /dev/null
+++ b/packages/app/src/utils/same.ts
@@ -0,0 +1,6 @@
+export 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])
+}