mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 05:13:29 +00:00
addEditCipherInfo w/ collections from state
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: bc5a6e02c1...24ffb55ce0
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user