Skip to content

Commit

Permalink
Merge pull request #53069 from c3024/do-not-make-requests-to-backend-…
Browse files Browse the repository at this point in the history
…updating-tour-seen-status-for-anonymous-users

[CP Staging] Do not make requests to backend when clicking on tour link for anonymous users visiting public rooms
  • Loading branch information
mountiny authored Nov 25, 2024
2 parents f4cccda + 727b364 commit ef9ca19
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/libs/actions/Welcome/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,12 @@ function resetAllChecks() {
OnboardingFlow.clearInitialPath();
}

function setSelfTourViewed() {
function setSelfTourViewed(shouldUpdateOnyxDataOnlyLocally = false) {
if (shouldUpdateOnyxDataOnlyLocally) {
Onyx.merge(ONYXKEYS.NVP_ONBOARDING, {selfTourViewed: true});
return;
}

const optimisticData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import * as App from '@userActions/App';
import * as IOU from '@userActions/IOU';
import * as Link from '@userActions/Link';
import * as Report from '@userActions/Report';
import * as Session from '@userActions/Session';
import * as Task from '@userActions/Task';
import * as Welcome from '@userActions/Welcome';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -560,9 +561,11 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu}: Fl
text: translate('tour.takeATwoMinuteTour'),
description: translate('tour.exploreExpensify'),
onSelected: () => {
Welcome.setSelfTourViewed();
Link.openExternalLink(navatticURL);
Task.completeTask(viewTourTaskReport);
Welcome.setSelfTourViewed(Session.isAnonymousUser());
if (viewTourTaskReport) {
Task.completeTask(viewTourTaskReport);
}
},
},
]
Expand Down

0 comments on commit ef9ca19

Please sign in to comment.