This commit is contained in:
Tiago Vasconcelos 2022-10-25 12:32:19 +01:00
parent 45ef9222fe
commit f3fc1e4a2b
2 changed files with 33 additions and 23 deletions

View file

@ -1960,14 +1960,14 @@
'/diagonalley/api/v1/orders/shipped/' + order_id,
this.g.user.wallets[0].inkey
)
.then((response) => {
.then(response => {
console.log(response.data)
this.orders = _.reject(this.orders, (obj) => {
this.orders = _.reject(this.orders, obj => {
return obj.id == order_id
})
this.orders.push(mapOrders(response.data))
})
.catch((error) => {
.catch(error => {
LNbits.utils.notifyApiError(error)
})
},

View file

@ -137,11 +137,21 @@
>Backup keys
<q-tooltip>Download your keys</q-tooltip>
</q-btn>
<q-btn outline color="grey" class="q-mx-sm" @click="keysDialog.show = true" :disabled="this.user.keys"
<q-btn
outline
color="grey"
class="q-mx-sm"
@click="keysDialog.show = true"
:disabled="this.user.keys"
>Restore keys
<q-tooltip>Restore keys</q-tooltip>
</q-btn>
<q-btn @click="deleteData" v-close-popup flat color="grey" class="q-ml-auto"
<q-btn
@click="deleteData"
v-close-popup
flat
color="grey"
class="q-ml-auto"
>Delete data
<q-tooltip>Delete all data from browser</q-tooltip>
</q-btn>
@ -155,10 +165,7 @@
position="top"
@hide="clearRestoreKeyDialog"
>
<q-card
class="q-pa-lg q-pt-xl lnbits__dialog-card"
>
</q-card>
<q-card class="q-pa-lg q-pt-xl lnbits__dialog-card"> </q-card>
<q-card class="q-pa-lg lnbits__dialog-card">
<q-form @submit="restoreKeys" class="q-gutter-md">
<q-input
@ -250,9 +257,13 @@
return `${key.slice(0, 4)}...${key.slice(-4)}`
},
downloadKeys() {
const file = new File([JSON.stringify(this.user.keys)], 'backup_keys.json', {
type: 'text/json',
})
const file = new File(
[JSON.stringify(this.user.keys)],
'backup_keys.json',
{
type: 'text/json'
}
)
const link = document.createElement('a')
const url = URL.createObjectURL(file)
@ -261,7 +272,6 @@
link.click()
window.URL.revokeObjectURL(url)
},
restoreKeys() {
this.user.keys = this.keysDialog.data