1
0
mirror of https://github.com/bitwarden/web synced 2025-12-15 07:43:16 +00:00

fix old attachments by reuploading them

This commit is contained in:
Kyle Spearrin
2018-11-14 15:20:17 -05:00
parent 9d4d64c95a
commit 8232a4c9c8
9 changed files with 62 additions and 7 deletions

View File

@@ -6,6 +6,8 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { UserService } from 'jslib/abstractions/user.service';
import { AttachmentView } from 'jslib/models/view/attachmentView';
import { AttachmentsComponent as BaseAttachmentsComponent } from 'jslib/angular/components/attachments.component';
@Component({
@@ -18,4 +20,14 @@ export class AttachmentsComponent extends BaseAttachmentsComponent {
platformUtilsService: PlatformUtilsService) {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, window);
}
protected async reupload(attachment: AttachmentView) {
if (this.showFixOldAttachments(attachment)) {
await this.reuploadCipherAttachment(attachment, false);
}
}
protected showFixOldAttachments(attachment: AttachmentView) {
return attachment.key == null && this.cipher.organizationId == null;
}
}