mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
share page optimizations
This commit is contained in:
@@ -5,6 +5,8 @@ import {
|
|||||||
Output,
|
Output,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';
|
||||||
|
|
||||||
import { CipherService } from '../../abstractions/cipher.service';
|
import { CipherService } from '../../abstractions/cipher.service';
|
||||||
import { CollectionService } from '../../abstractions/collection.service';
|
import { CollectionService } from '../../abstractions/collection.service';
|
||||||
import { I18nService } from '../../abstractions/i18n.service';
|
import { I18nService } from '../../abstractions/i18n.service';
|
||||||
@@ -39,10 +41,10 @@ export class ShareComponent implements OnInit {
|
|||||||
|
|
||||||
async load() {
|
async load() {
|
||||||
const allCollections = await this.collectionService.getAllDecrypted();
|
const allCollections = await this.collectionService.getAllDecrypted();
|
||||||
this.writeableCollections = allCollections.map((c) => c).filter((c) => !c.readOnly)
|
this.writeableCollections = allCollections.map((c) => c).filter((c) => !c.readOnly);
|
||||||
.sort(Utils.getSortFunction(this.i18nService, 'name'));
|
|
||||||
const orgs = await this.userService.getAllOrganizations();
|
const orgs = await this.userService.getAllOrganizations();
|
||||||
this.organizations = orgs.sort(Utils.getSortFunction(this.i18nService, 'name'));
|
this.organizations = orgs.sort(Utils.getSortFunction(this.i18nService, 'name'))
|
||||||
|
.filter((o) => o.enabled && o.status === OrganizationUserStatusType.Confirmed);
|
||||||
|
|
||||||
const cipherDomain = await this.cipherService.get(this.cipherId);
|
const cipherDomain = await this.cipherService.get(this.cipherId);
|
||||||
this.cipher = await cipherDomain.decrypt();
|
this.cipher = await cipherDomain.decrypt();
|
||||||
@@ -61,7 +63,7 @@ export class ShareComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async submit() {
|
async submit(): Promise<boolean> {
|
||||||
const cipherDomain = await this.cipherService.get(this.cipherId);
|
const cipherDomain = await this.cipherService.get(this.cipherId);
|
||||||
const cipherView = await cipherDomain.decrypt();
|
const cipherView = await cipherDomain.decrypt();
|
||||||
|
|
||||||
@@ -74,7 +76,9 @@ export class ShareComponent implements OnInit {
|
|||||||
this.platformUtilsService.showToast('success', null, this.i18nService.t('sharedItem'));
|
this.platformUtilsService.showToast('success', null, this.i18nService.t('sharedItem'));
|
||||||
});
|
});
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
|
return true;
|
||||||
} catch { }
|
} catch { }
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
get canSave() {
|
get canSave() {
|
||||||
|
|||||||
Reference in New Issue
Block a user