mirror of
https://github.com/MODSetter/SurfSense
synced 2026-06-21 13:44:09 +00:00
save clipboard contents on shortcut trigger
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user