mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-27 09:46:25 +02:00
save clipboard contents on shortcut trigger
This commit is contained in:
parent
0f846cd9c4
commit
0abbfbfe27
1 changed files with 3 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ const SHORTCUT = 'CommandOrControl+Option+S';
|
|||
let quickAskWindow: BrowserWindow | null = null;
|
||||
let pendingText = '';
|
||||
let sourceApp = '';
|
||||
let savedClipboard = '';
|
||||
|
||||
function getFrontmostApp(): string {
|
||||
if (process.platform !== 'darwin') return '';
|
||||
|
|
@ -97,8 +98,9 @@ export function registerQuickAsk(): void {
|
|||
}
|
||||
|
||||
sourceApp = getFrontmostApp();
|
||||
savedClipboard = clipboard.readText();
|
||||
|
||||
const text = clipboard.readText().trim();
|
||||
const text = savedClipboard.trim();
|
||||
if (!text) return;
|
||||
|
||||
pendingText = text;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue