bitwarden-estensione-browser/src/app/vault/attachments.component.ts

40 lines
1.6 KiB
TypeScript
Raw Normal View History

2018-06-06 23:25:57 +02:00
import { Component } from '@angular/core';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserService } from 'jslib-common/abstractions/user.service';
2018-06-06 23:25:57 +02:00
import { AttachmentView } from 'jslib-common/models/view/attachmentView';
import { AttachmentsComponent as BaseAttachmentsComponent } from 'jslib-angular/components/attachments.component';
2018-06-06 23:25:57 +02:00
@Component({
selector: 'app-vault-attachments',
templateUrl: 'attachments.component.html',
})
export class AttachmentsComponent extends BaseAttachmentsComponent {
viewOnly = false;
constructor(cipherService: CipherService, i18nService: I18nService,
2018-08-29 15:31:20 +02:00
cryptoService: CryptoService, userService: UserService,
platformUtilsService: PlatformUtilsService, apiService: ApiService,
logService: LogService) {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService, window,
logService);
2018-06-06 23:25:57 +02:00
}
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;
}
2018-06-06 23:25:57 +02:00
}