-
Notifications
You must be signed in to change notification settings - Fork 3k
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 - In debug menu any toggle action applied with a delay #54767
Comments
Triggered auto assignment to @bfitzexpensify ( |
Edited by proposal-police: This proposal was edited at 2025-01-03 03:07:12 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Wallet - Toggle is not response. User has to close debug menu and go to another tad to see change applied. What is the root cause of that problem?In the wallet page, we have Lottie Animation here App/src/pages/settings/Wallet/WalletPage/WalletPage.tsx Lines 373 to 378 in 1cfcfa4
And in debug menu we have Switch component, we handle onToggle callback insideInteractionManager.runAfterInteractions come from this PR #40650 and it never called because the Lottie Animation in the Wallet page is running loop
Note: This issue only occurs when using the Lines 45 to 53 in 1cfcfa4
What changes do you think we should make in order to solve the problem?We can replace setTimeout(() => {
if (disabled) {
disabledAction?.();
return;
}
onToggle(!isOn);
}, 0); or requestAnimationFrame(() => {
if (disabled) {
disabledAction?.();
return;
}
onToggle(!isOn);
}); Alternatively, we can remove POC
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?No, it only UI What alternative solutions did you explore? (Optional)We can consider adding a new prop to the <Switch
...
shouldRunAfterInteractions={false}
/> const handleSwitchPress = () => {
if (shouldRunAfterInteractions) {
InteractionManager.runAfterInteractions(() => {
if (disabled) {
disabledAction?.();
return;
}
onToggle(!isOn);
});
} else {
if (disabled) {
disabledAction?.();
return;
}
onToggle(!isOn);
}
} We can consider pause Lottie Animation when debug menu is opened here const [isTestToolsModalOpen = false] = useOnyx(ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN);
const isRenderedRef = useRef(false)
const isFocused = useIsFocused();
const prevIsTestToolsModalOpen = usePrevious(isTestToolsModalOpen);
useEffect(() => {
if (!isRenderedRef.current && !isFocused) return;
if (isTestToolsModalOpen) {
setHasNavigatedAway(true);
} else {
if (prevIsTestToolsModalOpen && animationRef.current) {
setHasNavigatedAway(false);
animationRef.current.play();
}
}
}, [isTestToolsModalOpen, prevIsTestToolsModalOpen, isFocused, isRenderedRef.current]); |
This is similar to #53208 |
@bfitzexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Issue was found while executing issue retest #54746
Version Number: v9.0.80-6
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: #54746
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: MacOS Catalina 10.15.7
App Component: Other
Action Performed:
Precondition: user is logged in desktop app.
Expected Result:
Toggle is switched immediately.
Actual Result:
Toggle is not response. User has to close debug menu and go to another tad to see change applied.
Workaround:
Unknown
Platforms:
Screenshots/Videos
bug.mp4
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: