Skip to content

Commit c2671cd

Browse files
committed
fixed vitest failed test
1 parent 2926262 commit c2671cd

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

docanalytics-web/src/app/features/security/two-factor-setup.component.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,8 @@ export class TwoFactorSetupComponent {
3434
private startSetup(): void {
3535
this.auth.setupTwoFactor().subscribe({
3636
next: async (res) => {
37-
if (res.error) {
38-
this.error.set(res.error.message);
39-
return;
40-
}
4137
if (!res.data) {
42-
this.error.set('Could not start 2FA setup.');
38+
this.error.set(res.error?.message ?? 'Could not start 2FA setup.');
4339
return;
4440
}
4541
this.manualKey.set(res.data.manual_key);
@@ -51,6 +47,7 @@ export class TwoFactorSetupComponent {
5147
});
5248
}
5349

50+
5451
protected confirm(): void {
5552
if (this.code().length !== 6) return;
5653
this.loading.set(true);

0 commit comments

Comments
 (0)