mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
feat: improve connection handling and status updates in SurfSense plugin
This commit is contained in:
parent
a5e5f229d9
commit
26ed2a2ba1
2 changed files with 4 additions and 0 deletions
|
|
@ -115,7 +115,9 @@ export class SurfSenseSettingTab extends PluginSettingTab {
|
|||
if (this.plugin.settings.searchSpaceId !== null) {
|
||||
try {
|
||||
await this.plugin.engine.ensureConnected();
|
||||
await this.plugin.engine.flushQueue();
|
||||
new Notice("Surfsense: vault connected.");
|
||||
this.display();
|
||||
} catch (err) {
|
||||
this.handleApiError(err);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ export class SyncEngine {
|
|||
this.setStatus("idle", "Pick a search space in settings.");
|
||||
return;
|
||||
}
|
||||
this.setStatus("syncing", "Connecting to SurfSense");
|
||||
try {
|
||||
const fingerprint = await computeVaultFingerprint(this.deps.app);
|
||||
const resp = await this.deps.apiClient.connect({
|
||||
|
|
@ -139,6 +140,7 @@ export class SyncEngine {
|
|||
s.vaultId = resp.vault_id;
|
||||
s.connectorId = resp.connector_id;
|
||||
});
|
||||
this.setStatus(this.queueStatusKind(), this.statusDetail());
|
||||
} catch (err) {
|
||||
this.handleStartupError(err);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue