Commit 3afe5eb8 authored by JC Brand's avatar JC Brand

Run the lodash converter only once.

parent e4d95eb7
......@@ -31,6 +31,7 @@ require.config({
"lodash": "node_modules/lodash/lodash",
"lodash.converter": "3rdparty/lodash.fp",
"lodash.noconflict": "src/lodash.noconflict",
"lodash.fp": "src/lodash.fp",
"pluggable": "node_modules/pluggable.js/dist/pluggable",
"polyfill": "src/polyfill",
"sizzle": "node_modules/jquery/sizzle/dist/sizzle",
......
......@@ -9,7 +9,7 @@
(function (root, factory) {
define(["jquery.noconflict",
"converse-core",
"lodash.converter",
"lodash.fp",
"tpl!add_contact_dropdown",
"tpl!add_contact_form",
"tpl!change_status_message",
......@@ -29,7 +29,7 @@
}(this, function (
$,
converse,
lodashConverter,
fp,
tpl_add_contact_dropdown,
tpl_add_contact_form,
tpl_change_status_message,
......@@ -49,7 +49,6 @@
const USERS_PANEL_ID = 'users';
const CHATBOX_TYPE = 'chatbox';
const { Strophe, Backbone, utils, _, moment } = converse.env;
const fp = lodashConverter(_.runInContext());
converse.plugins.add('converse-controlbox', {
......
......@@ -13,7 +13,7 @@
define([
"jquery.noconflict",
"converse-core",
"lodash.converter",
"lodash.fp",
"tpl!chatarea",
"tpl!chatroom",
"tpl!chatroom_disconnect",
......@@ -39,7 +39,7 @@
}(this, function (
$,
converse,
lodashConverter,
fp,
tpl_chatarea,
tpl_chatroom,
tpl_chatroom_disconnect,
......@@ -66,7 +66,6 @@
const CHATROOMS_TYPE = 'chatroom';
const { Strophe, Backbone, Promise, $iq, $build, $msg, $pres, b64_sha1, sizzle, utils, _, moment } = converse.env;
const fp = lodashConverter(_.runInContext());
// Add Strophe Namespaces
Strophe.addNamespace('MUC_ADMIN', Strophe.NS.MUC + "#admin");
......
define(['lodash', 'lodash.fpConverter'], function (_, lodashBrowserConvert) {
return lodashBrowserConvert(_.runInContext());
define(['lodash', 'lodash.converter', 'converse-core'], function (_, lodashConverter, converse) {
const fp = lodashConverter(_.runInContext());
converse.env.fp = fp;
return fp;
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment