From d79bfe6f28c1cace7790ce1328b966baa2205c0b Mon Sep 17 00:00:00 2001 From: JC Brand Date: Tue, 21 Feb 2017 09:35:50 +0100 Subject: [PATCH] Use composition instead of chaining. --- src/converse-core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/converse-core.js b/src/converse-core.js index cc95f4efa..45b1c5885 100755 --- a/src/converse-core.js +++ b/src/converse-core.js @@ -887,7 +887,7 @@ */ var resources = this.get('resources'); if (_.isObject(resources) && _.size(resources)) { - var val = _(resources).values().sortBy('priority').reverse().get(0); + var val = _.flow(_.values, _.partial(_.sortBy, _, 'priority'), _.reverse)(resources)[0]; if (!_.isUndefined(val)) { return val.status; }