From 5cd8cd87253877a21f29535b66b19b8e611c1a7f Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Tue, 18 Nov 2025 22:12:16 +0000 Subject: [PATCH] Remove apply settings button --- .../src/views/settings/settings-tab.ts | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/frontend/obsidian-plugin/src/views/settings/settings-tab.ts b/frontend/obsidian-plugin/src/views/settings/settings-tab.ts index cf4da91b..e4c16e6e 100644 --- a/frontend/obsidian-plugin/src/views/settings/settings-tab.ts +++ b/frontend/obsidian-plugin/src/views/settings/settings-tab.ts @@ -194,38 +194,28 @@ export class SyncSettingsTab extends PluginSettingTab { }) ); - new Setting(containerEl) - .addButton((button) => - button.setButtonText("Apply").onClick(async () => { + new Setting(containerEl).addButton((button) => + button + .setButtonText("Apply & test connection") + .onClick(async () => { if (this.areThereUnsavedChanges()) { await this.syncClient.setSettings({ vaultName: this.editedVaultName, remoteUri: this.editedServerUri, token: this.editedToken }); + new Notice("Checking connection to the server..."); new Notice( - "The changes have been applied successfully!" + ( + await this.syncClient.checkConnection() + ).serverMessage ); await this.statusDescription.updateConnectionState(); } else { new Notice("No changes to apply"); } }) - ) - .addButton((button) => - button.setButtonText("Test connection").onClick(async () => { - if (this.areThereUnsavedChanges()) { - new Notice( - "There are unsaved changes, testing with the currently saved settings" - ); - } - - new Notice( - (await this.syncClient.checkConnection()).serverMessage - ); - await this.statusDescription.updateConnectionState(); - }) - ); + ); } private areThereUnsavedChanges(): boolean {