Repository navigation
fix navigation for different assignees in confirmation flow #56732
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
Changes from all commits
1dd72aa
ba7bcf0
7eb930a
9da4a6b
cf36251
60a1c89
4722cfd
867522c
f5a57e5
9a7fa81
8f34ad6
3e49e20
85638f4
a177e5c
baad25d
57f24c1
f328608
e15accf
e15b3e1
cad4e37
7b1092b
b837f39
b453b3c
e4bb3ee
1b22dc7
767d2f0
78489cd
9013779
d48eff5
71af3fd
466be32
04acbc2
7a4a770
9abee4a
bc1535f
4a5826b
bfbd25d
7ab5f8b
024f2af
6b5a3d4
b8e2685
790cb86
25e1ad4
72465d9
43ee59d
6a8909c
2a58fac
fd28a68
c2d03a7
3a74b47
982696b
9211049
a76d803
44adf9d
aa686f8
68137f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import {useRef} from 'react'; | ||
|
|
||
| /** | ||
| * A hook that returns the initial non-undefined value of a variable. | ||
| * | ||
| * @param value The value to evaluate. | ||
| * @returns The first non-undefined value passed to the hook. | ||
| */ | ||
| function useInitial<T>(value: T | undefined): T | undefined { | ||
| const initialValueRef = useRef<T | undefined>(); | ||
| /* eslint-disable react-compiler/react-compiler */ | ||
| if (initialValueRef.current === undefined && value !== undefined) { | ||
| initialValueRef.current = value; | ||
| } | ||
|
|
||
| return initialValueRef.current; | ||
| /* eslint-enable react-compiler/react-compiler */ | ||
| } | ||
|
|
||
| export default useInitial; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,12 @@ function ConfirmationStep({policyID, backTo}: ConfirmationStepProps) { | |
| if (!isSuccessful) { | ||
| return; | ||
| } | ||
| Navigation.goBack(backTo ?? ROUTES.WORKSPACE_EXPENSIFY_CARD.getRoute(policyID)); | ||
| if (backTo) { | ||
| Navigation.goBack(backTo); | ||
| } else { | ||
| Navigation.navigate(ROUTES.WORKSPACE_EXPENSIFY_CARD.getRoute(policyID)); | ||
|
twilight2294 marked this conversation as resolved.
Resolved
Comment on lines
+61
to
+64
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @s77rt the problem you mentioned is because, when we navigate we still have the assignee screen modal in the stack which will get triggered when we go back via the back button: I tried using goBack with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bump @s77rt , i'm still looking but no new leads
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what is the best option here. I could see that this is a minor bug but even the original issue is a minor bug thus I don't think we want to "switch" bugs. Maybe we should explore a different solution at this point
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah based on the video I agree with @s77rt
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will investigate a potential solution over the weekend
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tried some solutions but didn't work, one solution is to remove the stack of the assignment screen and have the intial workspace page screen in the stack, testing that today
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found this hook used to handle hardware back button: https://github.com/Expensify/App/blob/main/src/hooks/useHandleBackButton/index.android.ts#L6 Trying to use it now
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @s77rt can you please retest this PR, I fixed the bug @yuwenmemon i think this PR is now ready to get merged
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Screen_recording_20250525_161514.mp4
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not able to test due to build errors but the added code lgtm and the video looks right
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have double workspace company cards pages after navigation here causing this issue #63116 |
||
| } | ||
|
Comment on lines
+61
to
+65
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This logic is missing from
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added 👍 |
||
|
|
||
|
Comment on lines
+61
to
+66
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change needed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, because we will be navigating to a |
||
| clearIssueNewCardFlow(policyID); | ||
| }, [backTo, policyID, isSuccessful]); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.