mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-01 09:17:29 +00:00
fix(dapps): Detach the pairInstructions popup from the pairing popup
closes #16887 The pairing popup can be destroyed while the pairInstructions popup is active. As a result the pair instructions popup will misbehave. To fix this, the pair instructions component is moved outside of the pair popup scope
This commit is contained in:
parent
2c4f6b5da3
commit
007f75ad4c
@ -173,6 +173,22 @@ SQUtils.QObject {
|
||||
onClosed: pairWCLoader.active = false
|
||||
onPair: (uri) => root.pairingRequested(uri)
|
||||
onPairUriChanged: (uri) => root.pairingValidationRequested(uri)
|
||||
onPairInstructionsRequested: pairInstructionsLoader.active = true
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: pairInstructionsLoader
|
||||
|
||||
active: false
|
||||
parent: root.visualParent
|
||||
|
||||
sourceComponent: Component {
|
||||
DAppsUriCopyInstructionsPopup{
|
||||
visible: true
|
||||
destroyOnClose: false
|
||||
onClosed: pairInstructionsLoader.active = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,7 @@ SQUtils.QObject {
|
||||
|
||||
/// Validates the pairing URI
|
||||
function validatePairingUri(uri) {
|
||||
timeoutTimer.start()
|
||||
d.validatePairingUri(uri)
|
||||
}
|
||||
|
||||
@ -190,14 +191,17 @@ SQUtils.QObject {
|
||||
root.pairingValidated(state)
|
||||
}
|
||||
|
||||
function onPairingResponse(key, state) {
|
||||
timeoutTimer.stop()
|
||||
function onPairingResponse(state) {
|
||||
if (state != Pairing.errors.uriOk) {
|
||||
d.reportPairErrorState(state)
|
||||
return
|
||||
}
|
||||
|
||||
timeoutTimer.restart()
|
||||
}
|
||||
|
||||
function onConnectDApp(dappChains, dappUrl, dappName, dappIcon, connectorId, key) {
|
||||
timeoutTimer.stop()
|
||||
const connectorIcon = Constants.dappImageByType[connectorId]
|
||||
root.connectDApp(dappChains, dappUrl, dappName, dappIcon, connectorIcon, key)
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ StatusDialog {
|
||||
|
||||
signal pair(string uri)
|
||||
signal pairUriChanged(string uri)
|
||||
signal pairInstructionsRequested()
|
||||
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||
|
||||
@ -72,12 +73,7 @@ StatusDialog {
|
||||
normalColor: linkColor
|
||||
|
||||
onClicked: {
|
||||
Global.openPopup(uriCopyInstructionsPopup)
|
||||
}
|
||||
|
||||
Component {
|
||||
id: uriCopyInstructionsPopup
|
||||
DAppsUriCopyInstructionsPopup{}
|
||||
root.pairInstructionsRequested()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user