summaryrefslogtreecommitdiff
path: root/apps/web/src/stores/keybindings/migrations/v6-to-v7.ts
diff options
context:
space:
mode:
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 };
+}