Skip to content

Commit

Permalink
Merge pull request Expensify#36556 from tienifr/fix/32292
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham authored Feb 25, 2024
2 parents 56bda00 + b5d3479 commit 89d5689
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/libs/actions/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,13 @@ function generateStatementPDF(period: string) {
function setContactMethodAsDefault(newDefaultContactMethod: string) {
const oldDefaultContactMethod = currentEmail;
const optimisticData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.ACCOUNT,
value: {
primaryLogin: newDefaultContactMethod,
},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.SESSION,
Expand Down Expand Up @@ -825,6 +832,13 @@ function setContactMethodAsDefault(newDefaultContactMethod: string) {
},
];
const failureData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.ACCOUNT,
value: {
primaryLogin: oldDefaultContactMethod,
},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.SESSION,
Expand Down

0 comments on commit 89d5689

Please sign in to comment.