mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
removed unnecessary method + doc within Settings Framework
This commit is contained in:
@@ -27,7 +27,7 @@ function trim(obj1, obj2) {
|
||||
|
||||
function mergeSettings(cfg, defCfg) {
|
||||
if (typeof cfg._settings !== typeof defCfg || typeof defCfg !== 'object') {
|
||||
return cfg._settings = defCfg;
|
||||
cfg._settings = defCfg;
|
||||
} else {
|
||||
expandObjBy(cfg._settings, defCfg);
|
||||
trim(cfg._settings, defCfg);
|
||||
@@ -103,22 +103,6 @@ Settings.prototype.persist = function (callback) {
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
Persists the settings if no settings are saved.
|
||||
@param callback Gets called when done.
|
||||
*/
|
||||
Settings.prototype.persistOnEmpty = function (callback) {
|
||||
var _this = this;
|
||||
meta.settings.get(this.hash, function (err, settings) {
|
||||
if (!settings._settings) {
|
||||
_this.persist(callback);
|
||||
} else if (typeof callback === 'function') {
|
||||
callback.call(_this);
|
||||
}
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
Returns the setting of given key or default value if not set.
|
||||
@param key The key of the setting to return.
|
||||
|
||||
Reference in New Issue
Block a user