mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-25 02:01:45 +02:00
figure out pathname, dont crash if callback isnt supplied
This commit is contained in:
@@ -120,7 +120,9 @@ define('forum/groups/details', ['iconSelect', 'vendor/colorpicker/colorpicker',
|
||||
}
|
||||
|
||||
if (settings.name) {
|
||||
ajaxify.go('groups/' + encodeURIComponent(settings.name));
|
||||
var pathname = window.location.pathname;
|
||||
pathname = pathname.substr(1, pathname.lastIndexOf('/'));
|
||||
ajaxify.go(pathname + encodeURIComponent(settings.name));
|
||||
} else {
|
||||
ajaxify.refresh();
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ module.exports = function(redisClient, module) {
|
||||
};
|
||||
|
||||
module.deleteAll = function(keys, callback) {
|
||||
callback = callback || function() {};
|
||||
var multi = redisClient.multi();
|
||||
for(var i=0; i<keys.length; ++i) {
|
||||
multi.del(keys[i]);
|
||||
@@ -91,16 +92,19 @@ module.exports = function(redisClient, module) {
|
||||
};
|
||||
|
||||
module.set = function(key, value, callback) {
|
||||
callback = callback || function() {};
|
||||
redisClient.set(key, value, function(err) {
|
||||
callback(err);
|
||||
});
|
||||
};
|
||||
|
||||
module.increment = function(key, callback) {
|
||||
callback = callback || function() {};
|
||||
redisClient.incr(key, callback);
|
||||
};
|
||||
|
||||
module.rename = function(oldKey, newKey, callback) {
|
||||
callback = callback || function() {};
|
||||
redisClient.rename(oldKey, newKey, function(err, res) {
|
||||
callback(err);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user