Enable wallet if just configured

This commit is contained in:
ekzyis 2024-06-20 20:16:47 +02:00
parent 1a2be99027
commit 0de82db78a
1 changed files with 3 additions and 1 deletions

View File

@ -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')