1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-03-12 13:39:14 +01:00

refactor submit logic

This commit is contained in:
rr-bw 2024-09-10 13:27:40 -07:00
parent 7d8886e4dc
commit feb16c3fd2
No known key found for this signature in database
GPG Key ID: 3FA13C3ADEE51D5D

View File

@ -190,25 +190,19 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
this.loginEmailService.clearValues();
await this.router.navigate(["update-temp-password"]);
} else {
// Browser/Desktop specific (start)
if (this.clientType === ClientType.Browser || this.clientType === ClientType.Desktop) {
await this.syncService.fullSync(true); // TODO-rr-bw: check -> browser uses `await` and desktop uses `return`. Why?
}
// Browser/Desktop specific (end)
// Web specific (start)
await this.goAfterLogIn(authResult.userId);
// Web specific (end)
// Browser/Desktop (start)
this.loginEmailService.clearValues();
if (this.clientType === ClientType.Browser) {
await this.router.navigate(["/tabs/vault"]);
if (this.clientType === ClientType.Web) {
await this.goAfterLogIn(authResult.userId);
} else {
await this.router.navigate(["vault"]);
await this.syncService.fullSync(true); // TODO-rr-bw: browser used `await`, desktop used `return`. Why?
this.loginEmailService.clearValues();
if (this.clientType === ClientType.Browser) {
await this.router.navigate(["/tabs/vault"]);
} else {
await this.router.navigate(["vault"]); // Desktop
}
}
// Browser/Desktop (end)
}
};