Browse Source

fix newRtMsg() and newFavMsg() undefined sig_userpost error alert

readme-update
Simon Grim 6 years ago
parent
commit
5ee1b4e5ee
  1. 23
      js/twister_actions.js

23
js/twister_actions.js

@ -285,11 +285,12 @@ function newRtMsg(postData, msg) {
sig_userpost = postData.attr('data-content_to_sigrt'); sig_userpost = postData.attr('data-content_to_sigrt');
} }
if (typeof sig_userpost === 'undefined') { if (!sig_userpost) {
alert(polyglot.t('error', alertPopup({
{error: 'can\'t sig_userpost is not deifned'} //txtTitle: polyglot.t(''), add some title (not 'error', please) or just KISS
)); txtMessage: 'Can\'t handle retwisting of a twist —\n'
+ polyglot.t('this is undefined', {'this': 'sig_userpost'})
});
return; return;
} }
@ -321,13 +322,15 @@ function newFavMsg(postData, priv, msg) {
var userpost = $.evalJSON(postData.attr('data-content_to_rt')); var userpost = $.evalJSON(postData.attr('data-content_to_rt'));
var sig_userpost = postData.attr('data-content_to_sigrt'); var sig_userpost = postData.attr('data-content_to_sigrt');
if (typeof sig_userpost === 'undefined') { if (!sig_userpost) {
alert(polyglot.t('error', alertPopup({
{error: 'can\'t sig_userpost is not deifned'} //txtTitle: polyglot.t(''), add some title (not 'error', please) or just KISS
)); txtMessage: 'Can\'t handle favoriting of a twist —\n'
+ polyglot.t('this is undefined', {'this': 'sig_userpost'})
});
return; return;
} }
var rtObj = {sig_userpost: sig_userpost, userpost: userpost}; var rtObj = {sig_userpost: sig_userpost, userpost: userpost};
if (typeof lastPostId !== 'undefined') { if (typeof lastPostId !== 'undefined') {

Loading…
Cancel
Save