Skip to content

Commit

Permalink
Revert to old syntax with .then()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciejSWM committed Mar 21, 2024
1 parent 84b1c5c commit 8168992
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
14 changes: 6 additions & 8 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1732,14 +1732,12 @@ function navigateToConciergeChat(shouldDismissModal = false, checkIfCurrentPageA
if (!conciergeChatReportID) {
// In order to avoid creating concierge repeatedly,
// we need to ensure that the server data has been successfully pulled
Welcome.onServerDataReady({
onReady: () => {
// If we don't have a chat with Concierge then create it
if (!checkIfCurrentPageActive()) {
return;
}
navigateToAndOpenReport([CONST.EMAIL.CONCIERGE], shouldDismissModal);
},
Welcome.onServerDataReady().then(() => {
// If we don't have a chat with Concierge then create it
if (!checkIfCurrentPageActive()) {
return;
}
navigateToAndOpenReport([CONST.EMAIL.CONCIERGE], shouldDismissModal);
});
} else if (shouldDismissModal) {
Navigation.dismissModal(conciergeChatReportID);
Expand Down
6 changes: 2 additions & 4 deletions src/libs/actions/Welcome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ const isOnboardingFlowStatusKnownPromise = new Promise<void>((resolve) => {
resolveOnboardingFlowStatus = resolve;
});

function onServerDataReady({onReady}: ServerDataReadyProps): Promise<void> {
return isServerDataReadyPromise.then(() => {
onReady();
});
function onServerDataReady(): Promise<void> {
return isServerDataReadyPromise;
}

/**
Expand Down

0 comments on commit 8168992

Please sign in to comment.