Skip to content

Commit

Permalink
fix(suite-native): dont show remember banner after disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
vytick committed May 17, 2024
1 parent d0030ed commit cbe0b2e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useToast } from '@suite-native/toasts';
import { Icon } from '@suite-common/icons';
import { TrezorDevice } from '@suite-common/suite-types';
import { prepareNativeStyle, useNativeStyles } from '@trezor/styles';
import { setViewOnlyCancelationTimestamp } from '@suite-native/settings';

const walletRowStyle = prepareNativeStyle(utils => ({
paddingHorizontal: utils.spacings.medium,
Expand Down Expand Up @@ -48,6 +49,11 @@ export const WalletRow = ({ device }: { device: TrezorDevice }) => {
payload: { enabled: !device.remember, origin: 'settingsToggle' },
});

if (device.remember) {
// if user disables view-only here, save the timestamp of the cancelation not to promote it later
dispatch(setViewOnlyCancelationTimestamp(new Date().getTime()));
}

if (!device.connected && device.remember) {
// disconnected device, view-only is being disabled so it can be forgotten
dispatch(deviceActions.forgetDevice(device));
Expand Down

0 comments on commit cbe0b2e

Please sign in to comment.