mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-13 00:51:45 +01:00
refactored a few properties into getters (#272)
This commit is contained in:
parent
0b79f112b9
commit
1968dbfee2
@ -35,9 +35,7 @@ export class AddEditComponent implements OnInit {
|
|||||||
|
|
||||||
copyLink = false;
|
copyLink = false;
|
||||||
disableSend = false;
|
disableSend = false;
|
||||||
editMode: boolean = false;
|
|
||||||
send: SendView;
|
send: SendView;
|
||||||
title: string;
|
|
||||||
deletionDate: string;
|
deletionDate: string;
|
||||||
expirationDate: string;
|
expirationDate: string;
|
||||||
hasPassword: boolean;
|
hasPassword: boolean;
|
||||||
@ -94,15 +92,19 @@ export class AddEditComponent implements OnInit {
|
|||||||
await this.load();
|
await this.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
async load() {
|
get editMode(): boolean {
|
||||||
this.editMode = this.sendId != null;
|
return this.sendId != null;
|
||||||
if (this.editMode) {
|
}
|
||||||
this.editMode = true;
|
|
||||||
this.title = this.i18nService.t('editSend');
|
|
||||||
} else {
|
|
||||||
this.title = this.i18nService.t('createSend');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
get title(): string {
|
||||||
|
return this.i18nService.t(
|
||||||
|
this.editMode ?
|
||||||
|
'editSend' :
|
||||||
|
'createSend'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async load() {
|
||||||
const policies = await this.policyService.getAll(PolicyType.DisableSend);
|
const policies = await this.policyService.getAll(PolicyType.DisableSend);
|
||||||
const organizations = await this.userService.getAllOrganizations();
|
const organizations = await this.userService.getAllOrganizations();
|
||||||
this.disableSend = organizations.some(o => {
|
this.disableSend = organizations.some(o => {
|
||||||
|
Loading…
Reference in New Issue
Block a user