From 4e8ead66a8753af2ab6cfcd02e27549d3e54ac79 Mon Sep 17 00:00:00 2001 From: Husain007 <94444107+HusainBhattiwala@users.noreply.github.com> Date: Fri, 6 Sep 2024 03:17:43 +0530 Subject: [PATCH] Fix URL to web, desktop settings pages on Desktop application (#903) Update web and desktop settings URLs on desktop application from previous 'config' path to new 'settings' path --- src/interface/desktop/chat.html | 4 ++-- src/interface/desktop/main.js | 8 ++++---- src/interface/desktop/preload.js | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/interface/desktop/chat.html b/src/interface/desktop/chat.html index 57657ef1..859e2c07 100644 --- a/src/interface/desktop/chat.html +++ b/src/interface/desktop/chat.html @@ -475,8 +475,8 @@ renderMessage(first_run_message, "khoj", null, null, true); // Open relevant setup links - document.getElementById("first-run-web-config").addEventListener('click', (event) => window.navigateAPI.navigateToWebSettings('config')); - document.getElementById("first-run-desktop-config").addEventListener('click', (event) => window.navigateAPI.navigateToSettings('config.html')); + document.getElementById("first-run-web-config").addEventListener('click', (event) => window.navigateAPI.navigateToWebSettings('settings')); + document.getElementById("first-run-desktop-config").addEventListener('click', (event) => window.navigateAPI.navigateToSettings('settings.html')); // Disable chat input field and update placeholder text document.getElementById("chat-input").setAttribute("disabled", "disabled"); diff --git a/src/interface/desktop/main.js b/src/interface/desktop/main.js index 54cf1fa6..d4208449 100644 --- a/src/interface/desktop/main.js +++ b/src/interface/desktop/main.js @@ -256,9 +256,9 @@ function pushDataToKhoj (regenerate = false) { .catch(error => { console.error(error); state["completed"] = false; - if (error?.response?.status === 429 && (BrowserWindow.getAllWindows().find(win => win.webContents.getURL().includes('config')))) { + if (error?.response?.status === 429 && (BrowserWindow.getAllWindows().find(win => win.webContents.getURL().includes('settings')))) { state["error"] = `Looks like you're out of space to sync your files. Upgrade your plan to unlock more space.`; - const win = BrowserWindow.getAllWindows().find(win => win.webContents.getURL().includes('config')); + const win = BrowserWindow.getAllWindows().find(win => win.webContents.getURL().includes('settings')); if (win) win.webContents.send('needsSubscription', true); } else if (error?.code === 'ECONNREFUSED') { state["error"] = `Could not connect to Khoj server. Ensure you can connect to it at ${error.address}:${error.port}.`; @@ -270,7 +270,7 @@ function pushDataToKhoj (regenerate = false) { .finally(() => { // Syncing complete syncing = false; - const win = BrowserWindow.getAllWindows().find(win => win.webContents.getURL().includes('config')); + const win = BrowserWindow.getAllWindows().find(win => win.webContents.getURL().includes('settings')); if (win) { win.webContents.send('update-state', state); } @@ -727,7 +727,7 @@ app.whenReady().then(() => { const contextMenu = Menu.buildFromTemplate([ { label: 'Chat', type: 'normal', click: () => { openWindow('chat.html'); }}, { label: 'Search', type: 'normal', click: () => { openWindow('search.html') }}, - { label: 'Configure', type: 'normal', click: () => { openWindow('config.html') }}, + { label: 'Configure', type: 'normal', click: () => { openWindow('settings.html') }}, { type: 'separator' }, { label: 'About Khoj', type: 'normal', click: () => { openAboutWindow(); } }, { label: 'Quit', type: 'normal', click: () => { app.quit() } } diff --git a/src/interface/desktop/preload.js b/src/interface/desktop/preload.js index e18c2b16..e8f13ff3 100644 --- a/src/interface/desktop/preload.js +++ b/src/interface/desktop/preload.js @@ -81,6 +81,6 @@ contextBridge.exposeInMainWorld('appInfoAPI', { }) contextBridge.exposeInMainWorld('navigateAPI', { - navigateToSettings: () => ipcRenderer.send('navigate', 'config.html'), - navigateToWebSettings: () => ipcRenderer.send('navigateToWebApp', 'config'), + navigateToSettings: () => ipcRenderer.send('navigate', 'settings.html'), + navigateToWebSettings: () => ipcRenderer.send('navigateToWebApp', 'settings'), })