Skip to content

Commit ca07023

Browse files
committed
[push] Fixing personalization on CE
1 parent ff6f763 commit ca07023

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

plugins/push/frontend/public/javascripts/component.push.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ window.component('push', function(push) {
174174
el.querySelectorAll('.pers').forEach(function(el){
175175
el.textContent = el.getAttribute('data-fallback');
176176

177-
var name = push.PERS_OPTS.filter(function(opt){ return opt.value() === el.getAttribute('data-key'); })[0];
177+
var name = push.PERS_OPTS && push.PERS_OPTS.filter(function(opt){ return opt.value() === el.getAttribute('data-key'); })[0];
178178
if (name) {
179179
name = name.title();
180180
}

plugins/push/frontend/public/javascripts/component.push.popup.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ window.component('push.popup', function(popup) {
405405
valuePers: l.messageTitlePers,
406406
valueCompiled: message.titleCompile.bind(message, l.value, true),
407407
placeholder: function () { return l.value === 'default' ? t('pu.po.tab2.mtitle.placeholder') : messageTitleHTML('default') || t('pu.po.tab2.mtitle.placeholder'); },
408-
persOpts: push.PERS_OPTS.length ? push.PERS_OPTS : undefined,
408+
persOpts: push.PERS_OPTS && push.PERS_OPTS.length ? push.PERS_OPTS : undefined,
409409
onToggle: function(v) { emojiPersOpen = v; }
410410
});
411411
l.messageCtrl = new C.emoji.controller({
@@ -416,7 +416,7 @@ window.component('push.popup', function(popup) {
416416
valueCompiled: message.messageCompile.bind(message, l.value, true),
417417
textarea: true,
418418
placeholder: function () { return l.value === 'default' ? t('pu.po.tab2.placeholder') : messageMessageHTML('default') || t('pu.po.tab2.placeholder'); },
419-
persOpts: push.PERS_OPTS.length ? push.PERS_OPTS : undefined,
419+
persOpts: push.PERS_OPTS && push.PERS_OPTS.length ? push.PERS_OPTS : undefined,
420420
onToggle: function(v) { emojiPersOpen = v; }
421421
});
422422

@@ -1238,7 +1238,7 @@ window.component('push.popup', function(popup) {
12381238
el.querySelectorAll('.pers').forEach(function(el){
12391239
el.textContent = el.getAttribute('data-fallback');
12401240

1241-
var name = push.PERS_OPTS.filter(function(opt){ return opt.value() === el.getAttribute('data-key'); })[0];
1241+
var name = push.PERS_OPTS && push.PERS_OPTS.filter(function(opt){ return opt.value() === el.getAttribute('data-key'); })[0];
12421242
if (name) {
12431243
name = name.title();
12441244
}
@@ -1275,7 +1275,7 @@ window.component('push.popup', function(popup) {
12751275
el.querySelectorAll('.pers').forEach(function(el){
12761276
el.textContent = el.getAttribute('data-fallback');
12771277

1278-
var name = push.PERS_OPTS.filter(function(opt){ return opt.value() === el.getAttribute('data-key'); })[0];
1278+
var name = push.PERS_OPTS && push.PERS_OPTS.filter(function(opt){ return opt.value() === el.getAttribute('data-key'); })[0];
12791279
if (name) {
12801280
name = name.title();
12811281
}

0 commit comments

Comments
 (0)