// Views the popup may reopen onto. // // The popup persists the current view so that reopening the toolbar popup // lands the user back where they were. Only views that can be fully // re-rendered from persisted state belong here; every other view falls back // to the nearest restorable parent (src/popup/index.js restoreView()). // // A view that displays a secret must NEVER be listed. Restoring onto one // would put a private key or a recovery phrase on screen with no password // prompt in front of it, on a popup the user may have reopened by accident. // That is why "export-privkey" and "show-phrase" are absent. // // Nor may a view whose button destroys a wallet be listed, for the mirror // reason: a popup reopened by accident must not land on the screen that // erases key material. That is why "delete-wallet-confirm" and // "delete-wallet-lost-password" are absent. // // Kept in its own module, with no dependencies, so tests can assert the // exclusion directly rather than trusting a reading of the popup entry // point. // // It sits under src/shared/ rather than src/popup/ because // src/shared/persistedState.js needs it and that module is in the BACKGROUND // bundle: a popup-path module reached from the worker is the shape // script/lib/forbiddenBundleInputs.js exists to keep out, whether or not the // particular module is harmless. const RESTORABLE_VIEWS = new Set([ "main", "address", "address-token", "receive", "settings", "settings-addtoken", "confirm-tx", "transaction", "wait-tx", "success-tx", "error-tx", ]); module.exports = { RESTORABLE_VIEWS };