mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 05:40:17 +00:00
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
This commit is contained in:
@@ -475,8 +475,8 @@
|
|||||||
renderMessage(first_run_message, "khoj", null, null, true);
|
renderMessage(first_run_message, "khoj", null, null, true);
|
||||||
|
|
||||||
// Open relevant setup links
|
// Open relevant setup links
|
||||||
document.getElementById("first-run-web-config").addEventListener('click', (event) => window.navigateAPI.navigateToWebSettings('config'));
|
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('config.html'));
|
document.getElementById("first-run-desktop-config").addEventListener('click', (event) => window.navigateAPI.navigateToSettings('settings.html'));
|
||||||
|
|
||||||
// Disable chat input field and update placeholder text
|
// Disable chat input field and update placeholder text
|
||||||
document.getElementById("chat-input").setAttribute("disabled", "disabled");
|
document.getElementById("chat-input").setAttribute("disabled", "disabled");
|
||||||
|
|||||||
@@ -256,9 +256,9 @@ function pushDataToKhoj (regenerate = false) {
|
|||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
state["completed"] = false;
|
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. <a href="https://app.khoj.dev/settings#subscription">Upgrade your plan</a> to unlock more space.`;
|
state["error"] = `Looks like you're out of space to sync your files. <a href="https://app.khoj.dev/settings#subscription">Upgrade your plan</a> 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);
|
if (win) win.webContents.send('needsSubscription', true);
|
||||||
} else if (error?.code === 'ECONNREFUSED') {
|
} else if (error?.code === 'ECONNREFUSED') {
|
||||||
state["error"] = `Could not connect to Khoj server. Ensure you can connect to it at ${error.address}:${error.port}.`;
|
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(() => {
|
.finally(() => {
|
||||||
// Syncing complete
|
// Syncing complete
|
||||||
syncing = false;
|
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) {
|
if (win) {
|
||||||
win.webContents.send('update-state', state);
|
win.webContents.send('update-state', state);
|
||||||
}
|
}
|
||||||
@@ -727,7 +727,7 @@ app.whenReady().then(() => {
|
|||||||
const contextMenu = Menu.buildFromTemplate([
|
const contextMenu = Menu.buildFromTemplate([
|
||||||
{ label: 'Chat', type: 'normal', click: () => { openWindow('chat.html'); }},
|
{ label: 'Chat', type: 'normal', click: () => { openWindow('chat.html'); }},
|
||||||
{ label: 'Search', type: 'normal', click: () => { openWindow('search.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' },
|
{ type: 'separator' },
|
||||||
{ label: 'About Khoj', type: 'normal', click: () => { openAboutWindow(); } },
|
{ label: 'About Khoj', type: 'normal', click: () => { openAboutWindow(); } },
|
||||||
{ label: 'Quit', type: 'normal', click: () => { app.quit() } }
|
{ label: 'Quit', type: 'normal', click: () => { app.quit() } }
|
||||||
|
|||||||
@@ -81,6 +81,6 @@ contextBridge.exposeInMainWorld('appInfoAPI', {
|
|||||||
})
|
})
|
||||||
|
|
||||||
contextBridge.exposeInMainWorld('navigateAPI', {
|
contextBridge.exposeInMainWorld('navigateAPI', {
|
||||||
navigateToSettings: () => ipcRenderer.send('navigate', 'config.html'),
|
navigateToSettings: () => ipcRenderer.send('navigate', 'settings.html'),
|
||||||
navigateToWebSettings: () => ipcRenderer.send('navigateToWebApp', 'config'),
|
navigateToWebSettings: () => ipcRenderer.send('navigateToWebApp', 'settings'),
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user