File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
apps/web/src/stores/keybindings/migrations Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { v2ToV3 } from "./v2-to-v3";
22import { v3ToV4 } from "./v3-to-v4" ;
33import { v4ToV5 } from "./v4-to-v5" ;
44import { v5ToV6 } from "./v5-to-v6" ;
5+ import { v6ToV7 } from "./v6-to-v7" ;
56
67type MigrationFn = ( { state } : { state : unknown } ) => unknown ;
78
@@ -10,9 +11,10 @@ const migrations: Record<number, MigrationFn> = {
1011 3 : v3ToV4 ,
1112 4 : v4ToV5 ,
1213 5 : v5ToV6 ,
14+ 6 : v6ToV7 ,
1315} ;
1416
15- export const CURRENT_VERSION = 6 ;
17+ export const CURRENT_VERSION = 7 ;
1618
1719export function runMigrations ( {
1820 state,
Original file line number Diff line number Diff line change 1+ import type { KeybindingConfig } from "@/lib/actions/keybinding" ;
2+
3+ interface V6State {
4+ keybindings : KeybindingConfig ;
5+ isCustomized : boolean ;
6+ }
7+
8+ export function v6ToV7 ( { state } : { state : unknown } ) : unknown {
9+ const v6 = state as V6State ;
10+ const keybindings = { ...v6 . keybindings } ;
11+
12+ for ( const key of Object . keys ( keybindings ) as Array < keyof KeybindingConfig > ) {
13+ if ( keybindings [ key ] === ( "split-element" as never ) ) {
14+ keybindings [ key ] = "split" ;
15+ }
16+ }
17+
18+ return { ...v6 , keybindings } ;
19+ }
You can’t perform that action at this time.
0 commit comments