Skip to content

Commit

Permalink
Remove hasDismissedModal logic
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisl committed May 30, 2024
1 parent 33253ab commit 5e18a77
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 37 deletions.
4 changes: 0 additions & 4 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ const ONYXKEYS = {
/** This NVP holds to most recent waypoints that a person has used when creating a distance expense */
NVP_RECENT_WAYPOINTS: 'expensify_recentWaypoints',

/** This NVP will be `true` if the user has ever dismissed the engagement modal on either OldDot or NewDot. If it becomes true it should stay true forever. */
NVP_HAS_DISMISSED_IDLE_PANEL: 'nvp_hasDismissedIdlePanel',

/** This NVP contains the choice that the user made on the engagement modal */
NVP_INTRO_SELECTED: 'nvp_introSelected',

Expand Down Expand Up @@ -628,7 +625,6 @@ type OnyxValuesMapping = {
[ONYXKEYS.FOCUS_MODE_NOTIFICATION]: boolean;
[ONYXKEYS.NVP_LAST_PAYMENT_METHOD]: OnyxTypes.LastPaymentMethod;
[ONYXKEYS.NVP_RECENT_WAYPOINTS]: OnyxTypes.RecentWaypoint[];
[ONYXKEYS.NVP_HAS_DISMISSED_IDLE_PANEL]: boolean;
[ONYXKEYS.NVP_INTRO_SELECTED]: OnyxTypes.IntroSelected;
[ONYXKEYS.NVP_LAST_SELECTED_DISTANCE_RATES]: OnyxTypes.LastSelectedDistanceRates;
[ONYXKEYS.PUSH_NOTIFICATIONS_ENABLED]: boolean;
Expand Down
20 changes: 0 additions & 20 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3413,25 +3413,6 @@ function completeOnboarding(
API.write(WRITE_COMMANDS.COMPLETE_GUIDED_SETUP, parameters, {optimisticData, successData, failureData});
}

function dismissEngagementModal() {
const parameters: SetNameValuePairParams = {
name: ONYXKEYS.NVP_HAS_DISMISSED_IDLE_PANEL,
value: true,
};

const optimisticData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.NVP_HAS_DISMISSED_IDLE_PANEL,
value: true,
},
];

API.write(WRITE_COMMANDS.SET_NAME_VALUE_PAIR, parameters, {
optimisticData,
});
}

/** Loads necessary data for rendering the RoomMembersPage */
function openRoomMembersPage(reportID: string) {
const parameters: OpenRoomMembersPageParams = {reportID};
Expand Down Expand Up @@ -3742,7 +3723,6 @@ export {
hasErrorInPrivateNotes,
getOlderActions,
getNewerActions,
dismissEngagementModal,
openRoomMembersPage,
savePrivateNotesDraft,
getDraftPrivateNote,
Expand Down
13 changes: 1 addition & 12 deletions src/libs/actions/Welcome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type OnyxPolicy from '@src/types/onyx/Policy';
import type {EmptyObject} from '@src/types/utils/EmptyObject';

let onboarding: Onboarding | [] | undefined;
let hasDismissedModal: boolean | undefined;
let isLoadingReportData = true;

type HasCompletedOnboardingFlowProps = {
Expand Down Expand Up @@ -58,7 +57,7 @@ function checkOnboardingDataReady() {
* Check if user dismissed modal and if report data are loaded
*/
function checkServerDataReady() {
if (isLoadingReportData || hasDismissedModal === undefined) {
if (isLoadingReportData) {
return;
}

Expand Down Expand Up @@ -91,16 +90,6 @@ Onyx.connect({
},
});

Onyx.connect({
key: ONYXKEYS.NVP_HAS_DISMISSED_IDLE_PANEL,
initWithStoredValues: true,
callback: (value) => {
hasDismissedModal = value ?? false;

checkServerDataReady();
},
});

Onyx.connect({
key: ONYXKEYS.IS_LOADING_REPORT_DATA,
initWithStoredValues: false,
Expand Down
1 change: 0 additions & 1 deletion src/libs/migrations/NVPMigration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const migrations = {
private_pushNotificationID: ONYXKEYS.NVP_PRIVATE_PUSH_NOTIFICATION_ID,
tryFocusMode: ONYXKEYS.NVP_TRY_FOCUS_MODE,
introSelected: ONYXKEYS.NVP_INTRO_SELECTED,
hasDismissedIdlePanel: ONYXKEYS.NVP_HAS_DISMISSED_IDLE_PANEL,
};

// This migration changes the keys of all the NVP related keys so that they are standardized
Expand Down

0 comments on commit 5e18a77

Please sign in to comment.