Merge branch 'master' into global-switchoff

This commit is contained in:
Kim Gardner
2018-05-15 17:55:35 -04:00
committed by GitHub
55 changed files with 530 additions and 352 deletions
+12
View File
@@ -55,6 +55,18 @@ class SettingsLoader {
// assembled Settings object.
return zipObject(fields, values);
}
/**
* get, like select, will retrieve the settings, but get will only return a
* single setting.
*
* @param {String} field the field to get
*/
async get(field) {
const value = await this._loader.load(field);
return value;
}
}
module.exports = () => ({ Settings: new SettingsLoader() });
+2 -2
View File
@@ -57,8 +57,8 @@ const Comment = {
asset({ asset_id }, _, { loaders: { Assets } }) {
return Assets.getByID.load(asset_id);
},
async editing(comment, _, { loaders: { Settings } }) {
const { editCommentWindowLength } = await Settings.select(
editing: async (comment, _, { loaders: { Settings } }) => {
const editCommentWindowLength = await Settings.get(
'editCommentWindowLength'
);