Skip to content

Commit

Permalink
Merge pull request #48667 from FitseTLT/fix-orginalFilename-optimisti…
Browse files Browse the repository at this point in the history
…c-data

Fix -  Workspace - Default avatar is different in full screen after uploading avatar and removing it
  • Loading branch information
MariaHCD authored Sep 9, 2024
2 parents 498d45c + ca73a7c commit 18e9883
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,7 @@ function updateWorkspaceAvatar(policyID: string, file: File) {
* Deletes the avatar image for the workspace
*/
function deleteWorkspaceAvatar(policyID: string) {
const policy = getPolicy(policyID);
const optimisticData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
Expand All @@ -1014,6 +1015,7 @@ function deleteWorkspaceAvatar(policyID: string) {
avatarURL: null,
},
avatarURL: '',
originalFileName: null,
},
},
];
Expand All @@ -1033,6 +1035,8 @@ function deleteWorkspaceAvatar(policyID: string) {
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
avatarURL: policy?.avatarURL,
originalFileName: policy?.originalFileName,
errorFields: {
avatarURL: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('avatarWithImagePicker.deleteWorkspaceError'),
},
Expand Down

0 comments on commit 18e9883

Please sign in to comment.