Skip to content

Commit

Permalink
feat message alert
Browse files Browse the repository at this point in the history
  • Loading branch information
sansan88 committed Sep 11, 2023
1 parent b83d9c3 commit 01e3455
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/app/pages/auth/login/login.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,22 @@ export class LoginPage implements OnInit {
this.router.navigateByUrl("");
});
} catch (err) {
let message = '';
let message = "Es ist ein allgemeiner Fehler aufgetreten: " + err.code + " / " + err.message;
console.error(err.code);

if (err.code == "auth/user-not-found") {
message = "Kein Account mit dieser E-Mail-Adresse gefunden."
} else if (err.code == "auth/wrong-password") {
message = "Die Kombination aus Benutzername und Passwort ist falsch."
} else {
message = "Es ist ein allgemeiner Fehler aufgetreten: " + err.code + " / " + err.message;
console.error(err.code);

}

this.alertCtrl
.create({
const alert = await this.alertCtrl.create({
message: message,
buttons: [{ text: "Ok", role: "cancel" }],
})
.then((alert) => {
alert.present();
buttons: [{ text: "OK", role: "cancel" }],
});

alert.present();
}
}
}

0 comments on commit 01e3455

Please sign in to comment.