-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Wallet] Fix last alert banner redisplayed on re-render #6325
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me, but I'm not sure I see why the alert would re-render if hideAlert
was already called in the past. I noticed the timestamp being passed, but feel like I'm missing some interaction.
I'm also still not completely clear on something, if the alert has an action, and that action doesn't hide the alert, the alert would not go away, right?
What happens is Now about your 2nd question, the alert state is cleared when the alert action is dispatched and hence dismisses the banner. celo-monorepo/packages/mobile/src/alert/reducer.ts Lines 61 to 64 in 51f643d
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, thanks for explaining, I saw the default in the reducer but didn't connect the dots.
I think it would be clearer/nice if after the 5 seconds the hide action was fired anyways. There's no reason I can think of to still have the action in the store if we never plan on showing it again and it can lead to this sort of bugs and having two different sources of truth makes it less clear imo (the state of the smart banner and the redux store).
Anyways, no need to change anything here, LGTM, just sharing my thoughts 😄
Yes we can revisit this later, this somewhat odd design was because of the separation between |
Hi @jeanregisser we have verified this issue on latest latest Android internal build V1.7.2(1004294329) &Test Flight build V1.7.2(39) and observe the following
Device: iPhone 6+ (12.4.5). Vivo V11 pro (10) Can you please let us know if we need to test anything else in this task |
Description
This fixes the regression described in #6314.
The change in #6230 made the underlying problem in
AlertBanner
more prominent as it caused the top level navigator to re-render on app state change (background/foreground/inactive) and hence theAlertBanner
.Other changes
Globally mock
Animated.View
andAnimated.ScrollView
to prevent out of memory error when a ref is set.See callstack/react-native-testing-library#539
Note: This change caused the Snapshot updates, because the styles are not flattened anymore for the mocked
Animated.View
.Tested
Related issues
Backwards compatibility
Yes