Skip to content

Commit

Permalink
do not make requests to backend for anon users
Browse files Browse the repository at this point in the history
  • Loading branch information
c3024 committed Nov 25, 2024
1 parent f4f8da7 commit f9f1207
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {ForwardedRef} from 'react';
import React, {forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react';
import {View} from 'react-native';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import {useOnyx} from 'react-native-onyx';
import Onyx, {useOnyx} from 'react-native-onyx';
import type {SvgProps} from 'react-native-svg';
import ConfirmModal from '@components/ConfirmModal';
import FloatingActionButton from '@components/FloatingActionButton';
Expand Down 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,18 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu}: Fl
text: translate('tour.takeATwoMinuteTour'),
description: translate('tour.exploreExpensify'),
onSelected: () => {
Welcome.setSelfTourViewed();
Link.openExternalLink(navatticURL);
Task.completeTask(viewTourTaskReport);
// Mark the tour as seen only locally for anonymous users visiting public rooms
if (Session.isAnonymousUser()) {
Onyx.merge(ONYXKEYS.NVP_ONBOARDING, {

Check failure on line 567 in src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Only actions should directly set or modify Onyx data. Please move this logic into a suitable action
selfTourViewed: true,
});
return;
}
Welcome.setSelfTourViewed();
if (viewTourTaskReport) {
Task.completeTask(viewTourTaskReport);
}
},
},
]
Expand Down

0 comments on commit f9f1207

Please sign in to comment.