mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-02 18:17:46 +01:00
addEditCipherInfo w/ collections from state
This commit is contained in:
parent
db83b042ff
commit
6c7a0d90df
2
jslib
2
jslib
@ -1 +1 @@
|
||||
Subproject commit bc5a6e02c106dc87413f22b7c7cb0334c1fc6e88
|
||||
Subproject commit 24ffb55ce0e781fb06cd04d318e9f70afe80d734
|
@ -6,6 +6,7 @@
|
||||
"sub:update": "git submodule update --remote",
|
||||
"sub:pull": "git submodule foreach git pull",
|
||||
"postinstall": "npm run sub:init && gulp postinstall",
|
||||
"simlink:win": "rm -rf ./jslib && cmd /c mklink /J .\\jslib ..\\jslib",
|
||||
"build": "gulp build && webpack",
|
||||
"build:watch": "gulp build && webpack --watch",
|
||||
"build:prod": "gulp build && cross-env NODE_ENV=production webpack",
|
||||
|
@ -144,7 +144,7 @@ export class AppComponent implements OnInit {
|
||||
this.stateService.remove('CiphersComponent');
|
||||
}
|
||||
if (url.startsWith('/tabs/')) {
|
||||
this.stateService.remove('addEditCipher');
|
||||
this.stateService.remove('addEditCipherInfo');
|
||||
}
|
||||
(window as any).previousPopupUrl = url;
|
||||
|
||||
|
@ -27,7 +27,10 @@ export class PasswordGeneratorComponent extends BasePasswordGeneratorComponent {
|
||||
|
||||
async ngOnInit() {
|
||||
await super.ngOnInit();
|
||||
this.cipherState = await this.stateService.get<CipherView>('addEditCipher');
|
||||
const addEditCipherInfo = await this.stateService.get<any>('addEditCipherInfo');
|
||||
if (addEditCipherInfo != null) {
|
||||
this.cipherState = addEditCipherInfo.cipher;
|
||||
}
|
||||
this.showSelect = this.cipherState != null;
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,11 @@ export class AddEditComponent extends BaseAddEditComponent {
|
||||
async generatePassword(): Promise<boolean> {
|
||||
const confirmed = await super.generatePassword();
|
||||
if (confirmed) {
|
||||
this.stateService.save('addEditCipher', this.cipher);
|
||||
this.stateService.save('addEditCipherInfo', {
|
||||
cipher: this.cipher,
|
||||
collectionIds: this.collections == null ? [] :
|
||||
this.collections.filter((c) => (c as any).checked).map((c) => c.id),
|
||||
});
|
||||
this.router.navigate(['generator']);
|
||||
}
|
||||
return confirmed;
|
||||
|
Loading…
Reference in New Issue
Block a user