Skip to content

Commit b605273

Browse files
committed
fix(web): initialize shortcuts in settings if undefined
1 parent 95f735d commit b605273

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/web/src/routes/(app)/settings/shortcuts.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ export default () => {
2323
const settings = useSettings();
2424

2525
const updateShortcut = (key: ShortcutKey, value: string[]) => {
26-
if (settings.store.shortcuts?.[key] !== value) {
26+
if (!settings.store.shortcuts) {
27+
settings.set("shortcuts", {});
28+
}
29+
if (settings.store.shortcuts![key] !== value) {
2730
settings.set("shortcuts", key, value);
2831
}
2932
};

0 commit comments

Comments
 (0)