fix: check if fields are not empty before sending request to the server

Closes #4643
This commit is contained in:
Miodec 2023-09-18 15:48:43 +01:00
parent 13aaf3a994
commit fe40988d6a

View file

@ -433,7 +433,12 @@ list["updateName"] = new SimplePopup(
try {
const user = Auth?.currentUser;
const snapshot = DB.getSnapshot();
if (!user || !snapshot) return;
if (!user || !snapshot) return true;
if (!pass || !newName) {
Notifications.add("Please fill in all fields", 0);
return false;
}
if (user.providerData.find((p) => p?.providerId === "password")) {
const credential = EmailAuthProvider.credential(