File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -448,7 +448,12 @@ export class AttachmentManager {
448
448
} ,
449
449
} ;
450
450
451
- this . upsertAttachments ( [ failedAttachment ] ) ;
451
+ const isAttachmentPresent = this . getAttachmentIndex (
452
+ failedAttachment . localMetadata . id ,
453
+ ) ;
454
+ if ( isAttachmentPresent !== - 1 ) {
455
+ this . upsertAttachments ( [ failedAttachment ] ) ;
456
+ }
452
457
return failedAttachment ;
453
458
}
454
459
@@ -482,11 +487,11 @@ export class AttachmentManager {
482
487
( uploadedAttachment as LocalNotImageAttachment ) . thumb_url = response . thumb_url ;
483
488
}
484
489
485
- if (
486
- this . attachments . some (
487
- ( att ) => att . localMetadata . id === uploadedAttachment . localMetadata . id ,
488
- )
489
- ) {
490
+ const isAttachmentPresent = this . getAttachmentIndex (
491
+ uploadedAttachment . localMetadata . id ,
492
+ ) ;
493
+
494
+ if ( isAttachmentPresent !== - 1 ) {
490
495
this . upsertAttachments ( [ uploadedAttachment ] ) ;
491
496
}
492
497
You can’t perform that action at this time.
0 commit comments