Skip to content

Commit 4e2e5e3

Browse files
committed
fix can't delete when originalFileName is not present
1 parent af41375 commit 4e2e5e3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/libs/actions/Policy/Policy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ function updateWorkspaceAvatar(policyID: string, currentAvatarURL: string | unde
16811681
/**
16821682
* Deletes the avatar image for the workspace
16831683
*/
1684-
function deleteWorkspaceAvatar(policyID: string, currentAvatarURL: string, currentOriginalFileName: string) {
1684+
function deleteWorkspaceAvatar(policyID: string, currentAvatarURL: string, currentOriginalFileName: string | undefined) {
16851685
const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.POLICY>> = [
16861686
{
16871687
onyxMethod: Onyx.METHOD.MERGE,

src/pages/workspace/WorkspaceOverviewPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ function WorkspaceOverviewPage({policyDraft, policy: policyProp, route}: Workspa
601601
updateWorkspaceAvatar(policyID, policy.avatarURL, file as File);
602602
}}
603603
onImageRemoved={() => {
604-
if (!policyID || !policy.avatarURL || !policy.originalFileName) {
604+
if (!policyID || !policy.avatarURL) {
605605
return;
606606
}
607607
deleteWorkspaceAvatar(policyID, policy.avatarURL, policy.originalFileName);

0 commit comments

Comments
 (0)