diff --git a/public/src/forum/accountsettings.js b/public/src/forum/accountsettings.js index 6f6d6edcbb..8746c1c5b3 100644 --- a/public/src/forum/accountsettings.js +++ b/public/src/forum/accountsettings.js @@ -10,8 +10,8 @@ define(['forum/accountheader'], function(header) { showemail: $('#showemailCheckBox').is(':checked') ? 1 : 0 }; - socket.emit('api:user.saveSettings', settings, function(success) { - if (success) { + socket.emit('api:user.saveSettings', settings, function(err) { + if (!err) { app.alertSuccess('Settings saved!'); } else { app.alertError('There was an error saving settings!'); diff --git a/src/websockets.js b/src/websockets.js index 3f2fb5e4a3..af9a9136b0 100644 --- a/src/websockets.js +++ b/src/websockets.js @@ -340,8 +340,9 @@ module.exports.init = function(io) { if (uid) { user.setUserFields(uid, { showemail: data.showemail + }, function(err) { + callback(err ? err.message : null); }); - callback(true); } });