default in create_wallet
This commit is contained in:
@@ -23,6 +23,7 @@ async def create_wallet(
|
|||||||
user=user_id,
|
user=user_id,
|
||||||
adminkey=uuid4().hex,
|
adminkey=uuid4().hex,
|
||||||
inkey=uuid4().hex,
|
inkey=uuid4().hex,
|
||||||
|
currency='USD',
|
||||||
)
|
)
|
||||||
await (conn or db).insert("wallets", wallet)
|
await (conn or db).insert("wallets", wallet)
|
||||||
return wallet
|
return wallet
|
||||||
|
|||||||
@@ -683,23 +683,4 @@ async def m029_create_audit_table(db: Connection):
|
|||||||
created_at TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}
|
created_at TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}
|
||||||
);
|
);
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
async def m030_add_currency_to_wallet(db: Connection):
|
|
||||||
"""
|
|
||||||
Setting currency to default is heavy, so easier just to add a trigger.
|
|
||||||
"""
|
|
||||||
await db.execute(
|
|
||||||
"""
|
|
||||||
CREATE TRIGGER IF NOT EXISTS set_default_currency
|
|
||||||
AFTER INSERT ON wallets
|
|
||||||
FOR EACH ROW
|
|
||||||
WHEN NEW.currency IS NULL
|
|
||||||
BEGIN
|
|
||||||
UPDATE wallets
|
|
||||||
SET currency = 'USD'
|
|
||||||
WHERE id = NEW.id;
|
|
||||||
END;
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
@@ -679,6 +679,7 @@ window.app = Vue.createApp({
|
|||||||
if (this.fiatTracking === false) {
|
if (this.fiatTracking === false) {
|
||||||
this.update.currency = ''
|
this.update.currency = ''
|
||||||
this.$q.localStorage.setItem('lnbits.isPrioritySwapped', false)
|
this.$q.localStorage.setItem('lnbits.isPrioritySwapped', false)
|
||||||
|
this.isPrioritySwapped = false
|
||||||
this.$q.localStorage.remove(`lnbits.exchangeRate`)
|
this.$q.localStorage.remove(`lnbits.exchangeRate`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -726,7 +727,7 @@ window.app = Vue.createApp({
|
|||||||
this.$q.localStorage.set('lnbits.disclaimerShown', true)
|
this.$q.localStorage.set('lnbits.disclaimerShown', true)
|
||||||
}
|
}
|
||||||
// check blanace priority
|
// check blanace priority
|
||||||
if (this.$q.localStorage.getItem('lnbits.isPrioritySwapped')) {
|
if (this.$q.localStorage.getItem('lnbits.isPrioritySwapped') && this.g.wallet.currenc) {
|
||||||
this.isPrioritySwapped = this.$q.localStorage.getItem(
|
this.isPrioritySwapped = this.$q.localStorage.getItem(
|
||||||
'lnbits.isPrioritySwapped'
|
'lnbits.isPrioritySwapped'
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user