mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-22 23:31:12 +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();
|
const text = clipboard.readText().trim();
|
||||||
if (!text) return;
|
if (!text) return;
|
||||||
|
|
||||||
|
const isExisting = quickAskWindow && !quickAskWindow.isDestroyed();
|
||||||
const cursor = screen.getCursorScreenPoint();
|
const cursor = screen.getCursorScreenPoint();
|
||||||
const win = createQuickAskWindow(cursor.x, cursor.y);
|
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) {
|
if (!ok) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue