🐛 Fix bug with notification

This commit is contained in:
ajnart
2023-03-21 11:39:34 +08:00
parent b923f8261b
commit c507a8892f

View File

@@ -18,7 +18,6 @@ function ModalContent() {
axios axios
.post('/api/configs/tryPassword', { tried: values.triedPassword, type: 'edit' }) .post('/api/configs/tryPassword', { tried: values.triedPassword, type: 'edit' })
.then((res) => { .then((res) => {
if (res.data.success) {
showNotification({ showNotification({
title: 'Success', title: 'Success',
message: 'Successfully toggled edit mode, reloading the page...', message: 'Successfully toggled edit mode, reloading the page...',
@@ -27,13 +26,13 @@ function ModalContent() {
setTimeout(() => { setTimeout(() => {
window.location.reload(); window.location.reload();
}, 500); }, 500);
} else { })
.catch((_) => {
showNotification({ showNotification({
title: 'Wrong password', title: 'Error',
message: 'The password you entered is wrong.', message: 'Failed to toggle edit mode, please try again.',
color: 'red', color: 'red',
}); });
}
}); });
})} })}
> >