Skip to content

Commit

Permalink
Merge pull request #33911 from Expensify/marco-timezoneAnonymousUser
Browse files Browse the repository at this point in the history
[NoQA] Avoid setting timezone and call private report notes for anonymous user
  • Loading branch information
deetergp authored Jan 4, 2024
2 parents 9364f4c + bf10105 commit b6aec5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libs/actions/PersonalDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {DateOfBirthForm, PersonalDetails, PersonalDetailsList, PrivatePersonalDetails} from '@src/types/onyx';
import type {SelectedTimezone, Timezone} from '@src/types/onyx/PersonalDetails';
import * as Session from './Session';

type FirstAndLastName = {
firstName: string;
Expand Down Expand Up @@ -264,6 +265,10 @@ function updateAddress(street: string, street2: string, city: string, state: str
* selected timezone if set to automatically update.
*/
function updateAutomaticTimezone(timezone: Timezone) {
if (Session.isAnonymousUser()) {
return;
}

if (!currentUserAccountID) {
return;
}
Expand Down
4 changes: 4 additions & 0 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,10 @@ const updatePrivateNotes = (reportID: string, accountID: number, note: string) =

/** Fetches all the private notes for a given report */
function getReportPrivateNote(reportID: string) {
if (Session.isAnonymousUser()) {
return;
}

if (!reportID) {
return;
}
Expand Down

0 comments on commit b6aec5b

Please sign in to comment.