summaryrefslogtreecommitdiff
path: root/apps/web/src/stores/keybindings/migrations/v6-to-v7.ts
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-04-15 03:57:51 +0200
committerMaze Winther <mazewinther@gmail.com>2026-04-15 03:57:51 +0200
commit4f7dc5ee3a02404d36d6d38fc42eb7980feb1fcc (patch)
tree121b878e62e2b14c235f21d50f90220c9cadfc92 /apps/web/src/stores/keybindings/migrations/v6-to-v7.ts
parent4e8b7d3745720ec0a63ad164ae8f22074ddd82f9 (diff)
downloadopencut-4f7dc5ee3a02404d36d6d38fc42eb7980feb1fcc.tar.gz
fix: remap split-element keybinding to split
Diffstat (limited to 'apps/web/src/stores/keybindings/migrations/v6-to-v7.ts')
-rw-r--r--apps/web/src/stores/keybindings/migrations/v6-to-v7.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/web/src/stores/keybindings/migrations/v6-to-v7.ts b/apps/web/src/stores/keybindings/migrations/v6-to-v7.ts
new file mode 100644
index 00000000..8c5fd96c
--- /dev/null
+++ b/apps/web/src/stores/keybindings/migrations/v6-to-v7.ts
@@ -0,0 +1,19 @@
+import type { KeybindingConfig } from "@/lib/actions/keybinding";
+
+interface V6State {
+ keybindings: KeybindingConfig;
+ isCustomized: boolean;
+}
+
+export function v6ToV7({ state }: { state: unknown }): unknown {
+ const v6 = state as V6State;
+ const keybindings = { ...v6.keybindings };
+
+ for (const key of Object.keys(keybindings) as Array<keyof KeybindingConfig>) {
+ if (keybindings[key] === ("split-element" as never)) {
+ keybindings[key] = "split";
+ }
+ }
+
+ return { ...v6, keybindings };
+}