Skip to content

Commit

Permalink
Fix opening Web, Desktop setup links on first run from Desktop app
Browse files Browse the repository at this point in the history
Previous version failed to open the setup links
  • Loading branch information
debanjum committed Jun 18, 2024
1 parent 632f55a commit 6814dad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/interface/desktop/chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 6814dad

Please sign in to comment.