qml: detect channel backups in send dialog
This commit is contained in:
@@ -13,6 +13,7 @@ ElDialog {
|
||||
property InvoiceParser invoiceParser
|
||||
|
||||
signal txFound(data: string)
|
||||
signal channelBackupFound(data: string)
|
||||
|
||||
parent: Overlay.overlay
|
||||
modal: true
|
||||
@@ -32,6 +33,8 @@ ElDialog {
|
||||
function dispatch(data) {
|
||||
if (bitcoin.isRawTx(data)) {
|
||||
txFound(data)
|
||||
} else if (Daemon.currentWallet.isValidChannelBackup(data)) {
|
||||
channelBackupFound(data)
|
||||
} else {
|
||||
invoiceParser.recipient = data
|
||||
}
|
||||
|
||||
@@ -308,6 +308,20 @@ Item {
|
||||
app.stack.push(Qt.resolvedUrl('TxDetails.qml'), { rawtx: data })
|
||||
close()
|
||||
}
|
||||
onChannelBackupFound: {
|
||||
var dialog = app.messageDialog.createObject(app, {
|
||||
text: qsTr('Import Channel backup?'),
|
||||
yesno: true
|
||||
})
|
||||
dialog.yesClicked.connect(function() {
|
||||
Daemon.currentWallet.importChannelBackup(data)
|
||||
close()
|
||||
})
|
||||
dialog.rejected.connect(function() {
|
||||
close()
|
||||
})
|
||||
dialog.open()
|
||||
}
|
||||
onClosed: destroy()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user