diff --git a/public/js/Room.js b/public/js/Room.js index d086d6f7..5650c029 100644 --- a/public/js/Room.js +++ b/public/js/Room.js @@ -1957,6 +1957,7 @@ function handleButtons() { }; notifyEmailCleanBtn.onclick = () => { rc.cleanNotifications(); + rc.saveNotifications(false); }; saveNotificationsBtn.onclick = () => { rc.saveNotifications(); diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index dc4c68d0..b5f80a35 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -10670,6 +10670,7 @@ class RoomClient { cleanNotifications() { getId('notifyEmailInput').value = ''; getId('switchNotifyUserJoin').checked = false; + return true; } saveNotifications(validate = true) { @@ -10684,12 +10685,9 @@ class RoomClient { setNotificationsData(data) { this.socket.emit('updateRoomNotifications', data, (response) => { - if (response.error) { - this.cleanNotifications(); - this.userLog('warning', response.error, 'top-end', 6000); - } else { - this.roomMessage('save_room_notifications', true); - } + response.error + ? this.cleanNotifications() && this.userLog('warning', response.error, 'top-end', 6000) + : this.roomMessage('save_room_notifications', true); }); }