Skip to content

Node.js based forum software built for the modern web

issue #427 - proper handling of theme reverting

Julian Lam5c70b2b30762
diff --git a/public/src/forum/admin/themes.js b/public/src/forum/admin/themes.js
index 1294656609..4e66561107 100644
--- a/public/src/forum/admin/themes.js
+++ b/public/src/forum/admin/themes.js
@@ -47,9 +47,17 @@ define(function() {
revertEl.addEventListener('click', function() {
bootbox.confirm('Are you sure you wish to remove the custom theme and restore the NodeBB default theme?', function(confirm) {
if (confirm) {
- require(['forum/admin/settings'], function(Settings) {
- Settings.remove('theme:id');
- Settings.remove('theme:src');
+ socket.emit('api:admin.theme.set', {
+ type: 'local',
+ id: 'nodebb-theme-cerulean'
+ }, function(err) {
+ app.alert({
+ alert_id: 'admin:theme',
+ type: 'success',
+ title: 'Theme Changed',
+ message: 'You have successfully reverted your NodeBB back to it\'s default theme. Please restart to see the changes.',
+ timeout: 3500
+ });
});
}
});