Skip to content

Commit 519b088

Browse files
committed
fix: deeplink entry modal subscribed user
1 parent 664e944 commit 519b088

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

ui/pages/settings/settings.component.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,18 @@ class SettingsPage extends PureComponent {
131131
componentDidMount() {
132132
this.handleConversionDate();
133133

134-
if (
135-
this.props.shouldShowShieldEntryModal &&
136-
!this.props.hasSubscribedToShield
137-
) {
138-
this.setState({ showShieldEntryModal: true });
134+
if (this.props.shouldShowShieldEntryModal) {
135+
// if user has subscribed to shield, navigate to shield page
136+
// otherwise, show shield entry modal
137+
if (this.props.hasSubscribedToShield) {
138+
// componentDidMount is rendered after useEffect() so we need setTimeout to ensure the navigation work
139+
// TODO: use navigate normally when refactor ot use functional component
140+
setTimeout(() => {
141+
this.props.navigate(TRANSACTION_SHIELD_ROUTE);
142+
});
143+
} else {
144+
this.setState({ showShieldEntryModal: true });
145+
}
139146
}
140147
}
141148

0 commit comments

Comments
 (0)