fix merge conflicts

This commit is contained in:
CREDO23 2026-04-04 09:39:20 +02:00
parent d7315e7f27
commit a180bf5576
5 changed files with 18 additions and 18 deletions

View file

@ -11,6 +11,7 @@ const SHORTCUT = 'CommandOrControl+Shift+Space';
let autocompleteEnabled = true;
let savedClipboard = '';
let sourceApp = '';
let lastSearchSpaceId: string | null = null;
function isSurfSenseWindow(): boolean {
const app = getFrontmostApp();
@ -36,19 +37,24 @@ async function triggerAutocomplete(): Promise<void> {
return;
}
const cursor = screen.getCursorScreenPoint();
const win = createSuggestionWindow(cursor.x, cursor.y);
let searchSpaceId = '1';
const mainWin = getMainWindow();
if (mainWin && !mainWin.isDestroyed()) {
const mainUrl = mainWin.webContents.getURL();
const match = mainUrl.match(/\/dashboard\/(\d+)/);
if (match) {
searchSpaceId = match[1];
lastSearchSpaceId = match[1];
}
}
if (!lastSearchSpaceId) {
console.warn('[autocomplete] No active search space. Open a search space first.');
return;
}
const searchSpaceId = lastSearchSpaceId;
const cursor = screen.getCursorScreenPoint();
const win = createSuggestionWindow(cursor.x, cursor.y);
win.webContents.once('did-finish-load', () => {
const sw = getSuggestionWindow();
setTimeout(() => {