mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Fix opening Web, Desktop setup links on first run from Desktop app
Previous version failed to open the setup links
This commit is contained in:
@@ -880,14 +880,18 @@
|
||||
function renderFirstRunSetupMessage() {
|
||||
first_run_message = `<p class="first-run-message-heading">Hi 👋🏾, to get started:<p>
|
||||
<ol>
|
||||
<li class="first-run-message-text">Generate an API token <a class='first-run-message-link' href="#" onclick="window.navigateAPI.navigateToWebSettings()">Khoj Web settings</a></li>
|
||||
<li class="first-run-message-text">Paste it into the API Key field <a class='first-run-message-link' href="#" onclick="window.navigateAPI.navigateToSettings()">Khoj Desktop settings</a></li>
|
||||
<li class="first-run-message-text">Generate an API token <a id='first-run-web-config' class='first-run-message-link'>Khoj Web settings</a></li>
|
||||
<li class="first-run-message-text">Paste it into the API Key field <a id='first-run-desktop-config' class='first-run-message-link'>Khoj Desktop settings</a></li>
|
||||
</ol>`
|
||||
.trim()
|
||||
.replace(/(\r\n|\n|\r)/gm, "");
|
||||
|
||||
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'));
|
||||
|
||||
// Disable chat input field and update placeholder text
|
||||
document.getElementById("chat-input").setAttribute("disabled", "disabled");
|
||||
document.getElementById("chat-input").setAttribute("placeholder", "Configure Khoj to enable chat");
|
||||
|
||||
Reference in New Issue
Block a user