Skip to content

Commit a239520

Browse files
author
Oleksandr Osadchyi
committed
MAGETWO-59135: [Github] Customer session is shared for different customers on two websites #4842 #6468
1 parent d5a846f commit a239520

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

app/code/Magento/Customer/view/frontend/web/js/invalidation-processor.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ define([
88
'Magento_Customer/js/customer-data'
99
], function (_, Element, customerData) {
1010
"use strict";
11+
var invalidationRules;
1112

1213
return Element.extend({
1314
initialize: function () {
@@ -23,18 +24,15 @@ define([
2324
process: function (customerData) {
2425
_.each(this.invalidationRules, function (rule, ruleName) {
2526
_.each(rule, function (ruleArgs, rulePath) {
26-
require([rulePath], this.initRule.bind(this));
27-
}, this);
28-
}, this);
29-
},
30-
31-
initRule: function () {
32-
var rule = new Rule(ruleArgs);
33-
34-
if (!_.isFunction(rule.process)) {
35-
throw new Error("Rule " + ruleName + " should implement invalidationProcessor interface");
36-
}
37-
rule.process(customerData);
27+
require([rulePath], function (Rule) {
28+
var rule = new Rule(ruleArgs);
29+
if (!_.isFunction(rule.process)) {
30+
throw new Error("Rule " + ruleName + " should implement invalidationProcessor interface");
31+
}
32+
rule.process(customerData);
33+
});
34+
});
35+
});
3836
}
3937
});
4038
});

0 commit comments

Comments
 (0)