mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-27 09:46:25 +02:00
fix: send clipboard text after page load on first open
This commit is contained in:
parent
296b95ba5b
commit
91ad36027d
1 changed files with 8 additions and 1 deletions
|
|
@ -62,10 +62,17 @@ export function registerQuickAsk(): void {
|
|||
const text = clipboard.readText().trim();
|
||||
if (!text) return;
|
||||
|
||||
const isExisting = quickAskWindow && !quickAskWindow.isDestroyed();
|
||||
const cursor = screen.getCursorScreenPoint();
|
||||
const win = createQuickAskWindow(cursor.x, cursor.y);
|
||||
|
||||
win.webContents.send(IPC_CHANNELS.QUICK_ASK_TEXT, text);
|
||||
if (isExisting) {
|
||||
win.webContents.send(IPC_CHANNELS.QUICK_ASK_TEXT, text);
|
||||
} else {
|
||||
win.webContents.once('did-finish-load', () => {
|
||||
win.webContents.send(IPC_CHANNELS.QUICK_ASK_TEXT, text);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (!ok) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue