From a89e7fbc2b1f69d8a43b4726658971f85c44490c Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Mon, 9 Feb 2026 17:26:46 -0800 Subject: [PATCH 1/2] Fix lint warnings in PasswordReminderService --- src/components/services/PasswordReminderService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/services/PasswordReminderService.ts b/src/components/services/PasswordReminderService.ts index c6d501fe0de..07a95d06a72 100644 --- a/src/components/services/PasswordReminderService.ts +++ b/src/components/services/PasswordReminderService.ts @@ -16,9 +16,9 @@ interface DispatchProps { type Props = StateProps & DispatchProps class PasswordReminderComponent extends React.PureComponent { - componentDidUpdate(prevProps: Props) { + componentDidUpdate(prevProps: Props): void { if ( - this.props.settingsLoaded && + this.props.settingsLoaded === true && !matchJson(prevProps.passwordReminder, this.props.passwordReminder) ) { this.props @@ -29,7 +29,7 @@ class PasswordReminderComponent extends React.PureComponent { } } - render() { + render(): React.JSX.Element | null { return null } } From 82377107284a697d80631616dffbd24ce0d57bc6 Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Mon, 9 Feb 2026 17:27:49 -0800 Subject: [PATCH 2/2] Fix security check notification not reappearing after dismissal PasswordReminderService unmounts on logout and remounts after LOGIN dispatches, so componentDidUpdate never fires for the initial LOGIN transition. Add componentDidMount to persist the reducer-computed passwordReminder state (including the incremented nonPasswordLoginsCount) on mount so the count advances on disk across login cycles. --- CHANGELOG.md | 1 + .../services/PasswordReminderService.ts | 71 ++++++++----------- 2 files changed, 29 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2d4cf8d13f..ed57f78251a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - added: Register SwapKit V3 as a separate exchange plugin - changed: Manage tokens scene saves changes on explicit save instead of live toggling - changed: Unify split wallet scene titles and add chain-specific descriptions for EVM and UTXO splits +- fixed: Security check notification not reappearing after dismissal ## 4.43.0 (2025-02-09) diff --git a/src/components/services/PasswordReminderService.ts b/src/components/services/PasswordReminderService.ts index 07a95d06a72..db913df1b2e 100644 --- a/src/components/services/PasswordReminderService.ts +++ b/src/components/services/PasswordReminderService.ts @@ -1,51 +1,36 @@ import * as React from 'react' import { setPasswordReminder } from '../../actions/LocalSettingsActions' -import { connect } from '../../types/reactRedux' -import type { PasswordReminder } from '../../types/types' +import { useAsyncEffect } from '../../hooks/useAsyncEffect' +import { + initialState, + type PasswordReminderState +} from '../../reducers/PasswordReminderReducer' +import { useDispatch, useSelector } from '../../types/reactRedux' import { matchJson } from '../../util/matchJson' -import { showError } from './AirshipInstance' -interface StateProps { - settingsLoaded: boolean | null - passwordReminder: PasswordReminder -} -interface DispatchProps { - setPasswordReminder: (passwordReminder: PasswordReminder) => Promise -} -type Props = StateProps & DispatchProps +interface Props {} -class PasswordReminderComponent extends React.PureComponent { - componentDidUpdate(prevProps: Props): void { - if ( - this.props.settingsLoaded === true && - !matchJson(prevProps.passwordReminder, this.props.passwordReminder) - ) { - this.props - .setPasswordReminder(this.props.passwordReminder) - .catch((error: unknown) => { - showError(error) - }) - } - } +export const PasswordReminderService: React.FC = props => { + const settingsLoaded = + useSelector(state => state.ui.settings.settingsLoaded) ?? false + const passwordReminder = useSelector(state => state.ui.passwordReminder) + const lastPasswordReminder = React.useRef(initialState) + const dispatch = useDispatch() - render(): React.JSX.Element | null { - return null - } -} + useAsyncEffect( + async () => { + if ( + settingsLoaded && + !matchJson(passwordReminder, lastPasswordReminder.current) + ) { + lastPasswordReminder.current = passwordReminder + await dispatch(setPasswordReminder(passwordReminder)) + } + }, + [settingsLoaded, passwordReminder], + 'PasswordReminderService' + ) -export const PasswordReminderService = connect< - StateProps, - DispatchProps, - unknown ->( - state => ({ - settingsLoaded: state.ui.settings.settingsLoaded, - passwordReminder: state.ui.passwordReminder - }), - dispatch => ({ - async setPasswordReminder(passwordReminder: PasswordReminder) { - await dispatch(setPasswordReminder(passwordReminder)) - } - }) -)(PasswordReminderComponent) + return null +}