diff --git a/components/form.js b/components/form.js index ea8c9996..1d9e150d 100644 --- a/components/form.js +++ b/components/form.js @@ -1350,21 +1350,11 @@ function PasswordScanner ({ onScan, text }) { loading: () => }) - const closeRef = useRef() - useEffect(() => { - return () => { - // close modal on remount to avoid calling stale callbacks - // see https://github.com/stackernews/stacker.news/pull/2313 - closeRef.current?.() - } - }, []) - return ( { showModal(onClose => { - closeRef.current = onClose return (
{text &&
{text}
} diff --git a/pages/wallets/index.js b/pages/wallets/index.js index 278a1fd9..c36bbaf6 100644 --- a/pages/wallets/index.js +++ b/pages/wallets/index.js @@ -49,7 +49,7 @@ export default function Wallet () { ? (
- + {PassphrasePrompt}
) diff --git a/wallets/client/hooks/crypto.js b/wallets/client/hooks/crypto.js index c01f033a..b4b5d164 100644 --- a/wallets/client/hooks/crypto.js +++ b/wallets/client/hooks/crypto.js @@ -238,42 +238,41 @@ export function usePassphrasePrompt () { const [showPassphrasePrompt, setShowPassphrasePrompt] = useState(false) const togglePassphrasePrompt = useCallback(() => setShowPassphrasePrompt(v => !v), []) - const Prompt = useMemo(() => - () => ( -
-

Wallet decryption

-

- Your wallets have been encrypted on another device. Enter your passphrase to use your wallets on this device. -

-

- {showPassphrase && 'You can find the button to reveal your passphrase above your wallets on the other device.'} -

-

- Press reset if you lost your passphrase. -

-
- -
-
- - - save -
+ const Prompt = useMemo(() => ( +
+

Wallet decryption

+

+ Your wallets have been encrypted on another device. Enter your passphrase to use your wallets on this device. +

+

+ {showPassphrase && 'You can find the button to reveal your passphrase above your wallets on the other device.'} +

+

+ Press reset if you lost your passphrase. +

+ + +
+
+ + + save
- -
- ), [showPassphrase, resetPassphrase, togglePassphrasePrompt, onSubmit, hash, salt]) +
+ +
+ ), [showPassphrase, resetPassphrase, togglePassphrasePrompt, onSubmit, hash, salt]) return useMemo( () => [showPassphrasePrompt, togglePassphrasePrompt, Prompt],