mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-22 11:45:59 +01:00
[PM-4077] safeincloud multiple url fix (#6394)
* safeincloud multiple url fix * Ensure LoginView.uris is consistently populated
This commit is contained in:
parent
00fd45a678
commit
96d1c83385
@ -17,7 +17,7 @@ export class LoginView extends ItemView {
|
||||
|
||||
passwordRevisionDate?: Date = null;
|
||||
totp: string = null;
|
||||
uris: LoginUriView[] = null;
|
||||
uris: LoginUriView[] = [];
|
||||
autofillOnPageLoad: boolean = null;
|
||||
fido2Credentials: Fido2CredentialView[] = null;
|
||||
|
||||
@ -62,7 +62,7 @@ export class LoginView extends ItemView {
|
||||
}
|
||||
|
||||
get hasUris(): boolean {
|
||||
return this.uris != null && this.uris.length > 0;
|
||||
return this.uris.length > 0;
|
||||
}
|
||||
|
||||
get hasFido2Credentials(): boolean {
|
||||
@ -84,7 +84,7 @@ export class LoginView extends ItemView {
|
||||
static fromJSON(obj: Partial<Jsonify<LoginView>>): LoginView {
|
||||
const passwordRevisionDate =
|
||||
obj.passwordRevisionDate == null ? null : new Date(obj.passwordRevisionDate);
|
||||
const uris = obj.uris?.map((uri: any) => LoginUriView.fromJSON(uri));
|
||||
const uris = obj.uris.map((uri: any) => LoginUriView.fromJSON(uri));
|
||||
const fido2Credentials = obj.fido2Credentials?.map((key) => Fido2CredentialView.fromJSON(key));
|
||||
|
||||
return Object.assign(new LoginView(), obj, {
|
||||
|
@ -81,7 +81,7 @@ export class SafeInCloudXmlImporter extends BaseImporter implements Importer {
|
||||
} else if (fieldType === "notes") {
|
||||
cipher.notes += text + "\n";
|
||||
} else if (fieldType === "weblogin" || fieldType === "website") {
|
||||
cipher.login.uris = this.makeUriArray(text);
|
||||
cipher.login.uris.push(...this.makeUriArray(text));
|
||||
} else {
|
||||
this.processKvp(cipher, name, text);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user