From 0de82db78a5424de7644bcb69c4226aac233e4e9 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Thu, 20 Jun 2024 20:16:47 +0200 Subject: [PATCH] Enable wallet if just configured --- pages/settings/wallets/[wallet].js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pages/settings/wallets/[wallet].js b/pages/settings/wallets/[wallet].js index f7b9d857..0f077415 100644 --- a/pages/settings/wallets/[wallet].js +++ b/pages/settings/wallets/[wallet].js @@ -36,9 +36,11 @@ export default function WalletSettings () { schema={lnbitsSchema} onSubmit={async ({ enabled, ...values }) => { try { + const newConfig = !wallet.isConfigured await wallet.validate(values) wallet.saveConfig(values) - if (enabled) wallet.enable() + // enable wallet if checkbox was set or if wallet was just configured + if (enabled || newConfig) wallet.enable() else wallet.disable() toaster.success('saved settings') router.push('/settings/wallets')