Skip to content

Commit

Permalink
respondendo com mensagem de erro caso a decriptografia venha vazio
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioconselheiro committed Apr 30, 2024
1 parent 5a5b940 commit 6b37c5b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/pages/decrypt-qrcode/decrypt-qrcode.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ export class DecryptQrcodeComponent implements OnInit {
const raw = this.form.getRawValue();
this.decryptService.decrypt(this.encrypted, raw.key)
.then(opened => {
this.router
.navigate(['/opened'], { state: { opened } });
if (opened) {
this.router
.navigate(['/opened'], { state: { opened } });
} else {
this.invalidKey = true;
}
})
.catch(e => {
console.error(e);
Expand Down

0 comments on commit 6b37c5b

Please sign in to comment.