Skip to content

Commit 49fd688

Browse files
committed
feat: store shortcuts
1 parent 357f607 commit 49fd688

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

packages/app/src/store/global.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { useContextStore } from './context'
88
import { useDOCXStore } from './docx'
99
import { useHistoryStore } from './history'
1010
import { useVaultStore } from './vault'
11+
import { useShortcutsStore } from './shortcuts'
1112

1213
export const useGlobalStore = defineStore('global', {
1314
state: (): GlobalState => {
@@ -23,6 +24,7 @@ export const useGlobalStore = defineStore('global', {
2324
const project = useProjectStore()
2425
const history = useHistoryStore()
2526
const vault = useVaultStore()
27+
const shortcuts = useShortcutsStore()
2628

2729
context.$reset()
2830
absolute.$reset()
@@ -32,6 +34,7 @@ export const useGlobalStore = defineStore('global', {
3234
project.$reset()
3335
history.$reset()
3436
vault.$reset()
37+
shortcuts.$reset()
3538
},
3639
},
3740
})

packages/app/src/use/storage/storage.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,19 @@ export const useStorage = () => {
301301
}
302302
}
303303

304+
if(!_.shortcuts) {
305+
_.shortcuts = {
306+
ctrlShiftP: true,
307+
ctrlShiftE: true,
308+
ctrlShiftH: true,
309+
ctrlShiftT: true,
310+
ctrlS: true,
311+
ctrlF: true,
312+
ctrlH: true,
313+
F11: true,
314+
}
315+
}
316+
304317
return _
305318
}
306319

0 commit comments

Comments
 (0)