2018-06-06 23:25:57 +02:00
|
|
|
import { Component } from '@angular/core';
|
|
|
|
|
2021-06-07 20:13:58 +02:00
|
|
|
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';
|
2021-10-20 18:30:04 +02:00
|
|
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
2021-06-07 20:13:58 +02:00
|
|
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
2021-12-14 17:10:26 +01:00
|
|
|
import { StateService } from 'jslib-common/abstractions/state.service';
|
2018-06-06 23:25:57 +02:00
|
|
|
|
2021-06-07 20:13:58 +02:00
|
|
|
import { AttachmentView } from 'jslib-common/models/view/attachmentView';
|
2018-11-14 21:20:17 +01:00
|
|
|
|
2021-06-07 20:13:58 +02:00
|
|
|
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 {
|
2021-02-01 17:37:32 +01:00
|
|
|
viewOnly = false;
|
|
|
|
|
2018-10-03 16:33:04 +02:00
|
|
|
constructor(cipherService: CipherService, i18nService: I18nService,
|
2021-12-14 17:10:26 +01:00
|
|
|
cryptoService: CryptoService, stateService: StateService,
|
|
|
|
platformUtilsService: PlatformUtilsService, apiService: ApiService, logService: LogService) {
|
|
|
|
super(cipherService, i18nService, cryptoService, platformUtilsService, apiService, window, logService,
|
|
|
|
stateService);
|
2018-06-06 23:25:57 +02:00
|
|
|
}
|
2018-11-14 21:20:17 +01: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
|
|
|
}
|