Skip to content

Commit

Permalink
fix: check if fields are not empty before sending request to the server
Browse files Browse the repository at this point in the history
Closes #4643
  • Loading branch information
Miodec committed Sep 18, 2023
1 parent 13aaf3a commit fe40988
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/ts/popups/simple-popups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit fe40988

Please sign in to comment.