Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Fixes wallet recovery dialogue re-appearing on relaunch after a successful recovery. #13850

Merged
merged 2 commits into from
Apr 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ class AboutPreferences extends React.Component {
ledgerRecoveryOverlayVisible: false
})
this.forceUpdate()
this.removeParams()
}

enableSyncRestore (enabled) {
Expand Down Expand Up @@ -552,6 +553,16 @@ class AboutPreferences extends React.Component {
this.setState(newState)
}

/**
* Using the history API, this removes any parameters
* from the current URL, leaving only the needed hash (ex #payments)
* This does not reload the page, it only modifies the browser history state,
* which replaces what is entered in the address bar
*/
removeParams () {
window.history.replaceState(null, null, `#${this.hash}`)
}

/**
* Parses a query string like:
* about:preferences#payments?ledgerBackupOverlayVisible
Expand Down Expand Up @@ -641,9 +652,12 @@ class AboutPreferences extends React.Component {
stateDiff['qrcodeOverlayVisible'] = false
}
this.setState(stateDiff)
// Tell ledger when Add Funds overlay is closed
if (isVisible === false && overlayName === 'addFunds') {
appActions.onAddFundsClosed()
if (isVisible === false) {
// Tell ledger when Add Funds overlay is closed
if (overlayName === 'addFunds') {
appActions.onAddFundsClosed()
}
this.removeParams()
}
}

Expand Down