mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-04 05:12:38 +02:00
Restore default desktop shortcuts and Linux pack scripts
This commit is contained in:
parent
ed0bcafe49
commit
ba25c68c0d
3 changed files with 16 additions and 5 deletions
|
|
@ -4,8 +4,8 @@ export interface ShortcutConfig {
|
|||
}
|
||||
|
||||
const DEFAULTS: ShortcutConfig = {
|
||||
generalAssist: 'Alt+Shift+G',
|
||||
quickAsk: 'Alt+Shift+Q',
|
||||
generalAssist: 'CommandOrControl+Shift+S',
|
||||
quickAsk: 'CommandOrControl+Alt+S',
|
||||
};
|
||||
|
||||
const STORE_KEY = 'shortcuts';
|
||||
|
|
@ -23,10 +23,20 @@ async function getStore() {
|
|||
return store;
|
||||
}
|
||||
|
||||
/** One-time fix if both shortcuts match the mistaken Alt+Shift pair. */
|
||||
function wasRegressionAltPair(rest: Record<string, string>): boolean {
|
||||
return rest.generalAssist === 'Alt+Shift+G' && rest.quickAsk === 'Alt+Shift+Q';
|
||||
}
|
||||
|
||||
export async function getShortcuts(): Promise<ShortcutConfig> {
|
||||
const s = await getStore();
|
||||
const raw = (s.get(STORE_KEY) as Record<string, string> | undefined) ?? {};
|
||||
const { autocomplete: _drop, ...rest } = raw;
|
||||
if (wasRegressionAltPair(rest)) {
|
||||
const fixed = { ...DEFAULTS };
|
||||
s.set(STORE_KEY, { ...fixed });
|
||||
return fixed;
|
||||
}
|
||||
return { ...DEFAULTS, ...rest };
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue