mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-08 04:34:01 +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
|
onClosed: pairWCLoader.active = false
|
||||||
onPair: (uri) => root.pairingRequested(uri)
|
onPair: (uri) => root.pairingRequested(uri)
|
||||||
onPairUriChanged: (uri) => root.pairingValidationRequested(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
|
/// Validates the pairing URI
|
||||||
function validatePairingUri(uri) {
|
function validatePairingUri(uri) {
|
||||||
|
timeoutTimer.start()
|
||||||
d.validatePairingUri(uri)
|
d.validatePairingUri(uri)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,14 +191,17 @@ SQUtils.QObject {
|
|||||||
root.pairingValidated(state)
|
root.pairingValidated(state)
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPairingResponse(key, state) {
|
function onPairingResponse(state) {
|
||||||
timeoutTimer.stop()
|
|
||||||
if (state != Pairing.errors.uriOk) {
|
if (state != Pairing.errors.uriOk) {
|
||||||
d.reportPairErrorState(state)
|
d.reportPairErrorState(state)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
timeoutTimer.restart()
|
||||||
}
|
}
|
||||||
|
|
||||||
function onConnectDApp(dappChains, dappUrl, dappName, dappIcon, connectorId, key) {
|
function onConnectDApp(dappChains, dappUrl, dappName, dappIcon, connectorId, key) {
|
||||||
|
timeoutTimer.stop()
|
||||||
const connectorIcon = Constants.dappImageByType[connectorId]
|
const connectorIcon = Constants.dappImageByType[connectorId]
|
||||||
root.connectDApp(dappChains, dappUrl, dappName, dappIcon, connectorIcon, key)
|
root.connectDApp(dappChains, dappUrl, dappName, dappIcon, connectorIcon, key)
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ StatusDialog {
|
|||||||
|
|
||||||
signal pair(string uri)
|
signal pair(string uri)
|
||||||
signal pairUriChanged(string uri)
|
signal pairUriChanged(string uri)
|
||||||
|
signal pairInstructionsRequested()
|
||||||
|
|
||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||||
|
|
||||||
@ -72,12 +73,7 @@ StatusDialog {
|
|||||||
normalColor: linkColor
|
normalColor: linkColor
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Global.openPopup(uriCopyInstructionsPopup)
|
root.pairInstructionsRequested()
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: uriCopyInstructionsPopup
|
|
||||||
DAppsUriCopyInstructionsPopup{}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user