Skip to content
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

Fix onboarding can be skipped if you kill the app after the modal opens #44062

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/Expensify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ function Expensify({
const isAuthenticated = useMemo(() => !!(session?.authToken ?? null), [session]);
const autoAuthState = useMemo(() => session?.autoAuthState ?? '', [session]);

const isAuthenticatedRef = useRef(false);
isAuthenticatedRef.current = isAuthenticated;

const contextValue = useMemo(
() => ({
isSplashHidden,
Expand Down Expand Up @@ -198,8 +195,7 @@ function Expensify({

// Open chat report from a deep link (only mobile native)
Linking.addEventListener('url', (state) => {
// We need to pass 'isAuthenticated' to avoid loading a non-existing profile page twice
Report.openReportFromDeepLink(state.url, !isAuthenticatedRef.current);
Report.openReportFromDeepLink(state.url);
});

return () => {
Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2491,7 +2491,7 @@ function toggleEmojiReaction(
addEmojiReaction(originalReportID, reportAction.reportActionID, emoji, skinTone);
}

function openReportFromDeepLink(url: string, shouldNavigate = true) {
function openReportFromDeepLink(url: string) {
const reportID = ReportUtils.getReportIDFromLink(url);
const isAuthenticated = Session.hasAuthToken();

Expand Down Expand Up @@ -2535,7 +2535,7 @@ function openReportFromDeepLink(url: string, shouldNavigate = true) {
return;
}

if (!shouldNavigate) {
if (isAuthenticated) {
return;
}

Expand Down
1 change: 0 additions & 1 deletion src/libs/actions/Welcome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ function setOnboardingPolicyID(policyID?: string) {

Onyx.connect({
key: ONYXKEYS.NVP_ONBOARDING,
initWithStoredValues: false,
callback: (value) => {
if (value === undefined) {
return;
Expand Down
Loading