mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-23 03:59:38 +00:00
Don't set a default payment ID on receive page
This commit is contained in:
parent
aeea9ad324
commit
43a33e717d
1 changed files with 18 additions and 13 deletions
|
@ -51,16 +51,22 @@ Rectangle {
|
|||
function updatePaymentId(payment_id) {
|
||||
if (typeof appWindow.currentWallet === 'undefined' || appWindow.currentWallet == null)
|
||||
return
|
||||
|
||||
// generate a new one if not given as argument
|
||||
if (typeof payment_id === 'undefined') {
|
||||
payment_id = appWindow.currentWallet.generatePaymentId()
|
||||
appWindow.persistentSettings.payment_id = payment_id
|
||||
paymentIdLine.text = payment_id
|
||||
}
|
||||
addressLine.text = appWindow.currentWallet.address
|
||||
integratedAddressLine.text = appWindow.currentWallet.integratedAddress(payment_id)
|
||||
if (integratedAddressLine.text === "")
|
||||
integratedAddressLine.text = qsTr("Invalid payment ID")
|
||||
|
||||
if (payment_id.length > 0) {
|
||||
integratedAddressLine.text = appWindow.currentWallet.integratedAddress(payment_id)
|
||||
if (integratedAddressLine.text === "")
|
||||
integratedAddressLine.text = qsTr("Invalid payment ID")
|
||||
}
|
||||
else {
|
||||
integratedAddressLine.text = ""
|
||||
}
|
||||
|
||||
update()
|
||||
}
|
||||
|
||||
|
@ -243,13 +249,10 @@ Rectangle {
|
|||
pressedColor: "#FF4304"
|
||||
text: qsTr("Generate") + translationManager.emptyString;
|
||||
anchors.right: parent.right
|
||||
onClicked: {
|
||||
appWindow.persistentSettings.payment_id = appWindow.currentWallet.generatePaymentId();
|
||||
updatePaymentId()
|
||||
}
|
||||
onClicked: updatePaymentId()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RowLayout {
|
||||
id: integratedAddressRow
|
||||
Label {
|
||||
|
@ -414,12 +417,14 @@ Rectangle {
|
|||
function onPageCompleted() {
|
||||
console.log("Receive page loaded");
|
||||
|
||||
if(addressLine.text.length === 0 || addressLine.text !== appWindow.currentWallet.address) {
|
||||
updatePaymentId()
|
||||
if (appWindow.currentWallet) {
|
||||
if (addressLine.text.length === 0 || addressLine.text !== appWindow.currentWallet.address) {
|
||||
addressLine.text = appWindow.currentWallet.address
|
||||
}
|
||||
}
|
||||
|
||||
update()
|
||||
timer.running = true
|
||||
|
||||
}
|
||||
|
||||
function onPageClosed() {
|
||||
|
|
Loading…
Reference in a new issue