mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-25 19:15:18 +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
|
|
@ -7,10 +7,11 @@
|
|||
"dev": "pnpm build && concurrently -k \"pnpm --dir ../surfsense_web dev\" \"wait-on http://localhost:3000 && node scripts/electron-dev.mjs\"",
|
||||
"build": "node scripts/build-electron.mjs",
|
||||
"pack:dir": "pnpm build && electron-builder --dir --config electron-builder.yml",
|
||||
"pack:dir:linux": "pnpm build && electron-builder --dir --linux --config electron-builder.yml -c.npmRebuild=false",
|
||||
"dist": "pnpm build && electron-builder --config electron-builder.yml",
|
||||
"dist:mac": "pnpm build && electron-builder --mac --config electron-builder.yml",
|
||||
"dist:win": "pnpm build && electron-builder --win --config electron-builder.yml",
|
||||
"dist:linux": "pnpm build && electron-builder --linux --config electron-builder.yml",
|
||||
"dist:linux": "pnpm build && electron-builder --linux --config electron-builder.yml -c.npmRebuild=false",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"postinstall": "node scripts/postinstall-rebuild.mjs"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ export function acceleratorToDisplay(accel: string): string[] {
|
|||
}
|
||||
|
||||
export const DEFAULT_SHORTCUTS = {
|
||||
generalAssist: "Alt+Shift+G",
|
||||
quickAsk: "Alt+Shift+Q",
|
||||
generalAssist: "CommandOrControl+Shift+S",
|
||||
quickAsk: "CommandOrControl+Alt+S",
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue