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

[CP Staging] Do not make requests to backend when clicking on tour link for anonymous users visiting public rooms #53069

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
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);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without checking whether the current user can complete the task we called the API, this caused #53563

},
},
]
Expand Down
Loading