Enable wallet if just configured
This commit is contained in:
parent
1a2be99027
commit
0de82db78a
|
@ -36,9 +36,11 @@ export default function WalletSettings () {
|
||||||
schema={lnbitsSchema}
|
schema={lnbitsSchema}
|
||||||
onSubmit={async ({ enabled, ...values }) => {
|
onSubmit={async ({ enabled, ...values }) => {
|
||||||
try {
|
try {
|
||||||
|
const newConfig = !wallet.isConfigured
|
||||||
await wallet.validate(values)
|
await wallet.validate(values)
|
||||||
wallet.saveConfig(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()
|
else wallet.disable()
|
||||||
toaster.success('saved settings')
|
toaster.success('saved settings')
|
||||||
router.push('/settings/wallets')
|
router.push('/settings/wallets')
|
||||||
|
|
Loading…
Reference in New Issue