mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 13:23:15 +00:00
Fix Connectivity Check in Obsidian Client (#559) from dtkav/bugfix-local-connectivity-check
Check connection to Khoj server for self-hosted server. This check had regressed during the cloud rearchitecture
This commit is contained in:
@@ -73,8 +73,7 @@ export default class Khoj extends Plugin {
|
|||||||
// Check if khoj backend is configured, note if cannot connect to backend
|
// Check if khoj backend is configured, note if cannot connect to backend
|
||||||
let headers = { "Authorization": `Bearer ${this.settings.khojApiKey}` };
|
let headers = { "Authorization": `Bearer ${this.settings.khojApiKey}` };
|
||||||
|
|
||||||
if (this.settings.khojUrl === "https://app.khoj.dev") {
|
if (this.settings.khojApiKey === "" && this.settings.khojUrl === "https://app.khoj.dev") {
|
||||||
if (this.settings.khojApiKey === "") {
|
|
||||||
new Notice(`❗️Khoj API key is not configured. Please visit https://app.khoj.dev/config#clients to get an API key.`);
|
new Notice(`❗️Khoj API key is not configured. Please visit https://app.khoj.dev/config#clients to get an API key.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -88,7 +87,6 @@ export default class Khoj extends Plugin {
|
|||||||
new Notice(`❗️Ensure Khoj backend is running and Khoj URL is pointing to it in the plugin settings.\n\n${error}`);
|
new Notice(`❗️Ensure Khoj backend is running and Khoj URL is pointing to it in the plugin settings.\n\n${error}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
async saveSettings() {
|
async saveSettings() {
|
||||||
this.saveData(this.settings);
|
this.saveData(this.settings);
|
||||||
|
|||||||
Reference in New Issue
Block a user