fix checks for twist .msg fields emptiness when it's need to decide whether twist should be displayed or not

This commit is contained in:
Simon Grim 2016-03-25 03:11:08 +05:00
parent 5c5f262ca0
commit cfd51f163e
2 changed files with 7 additions and 9 deletions

View File

@ -156,12 +156,12 @@ function requestRTs(postLi)
}
}
function appendPostToElem(postFromJson, elem) {
// posts without 'msg' and 'rt' may be used for metadata like 'url' and are not meant to be displayed
if (!postFromJson.userpost.msg && !postFromJson.userpost.rt)
function appendPostToElem(post, elem) {
// posts without 'msg' and 'rt.msg' may be used for metadata like 'url' and are not meant to be displayed
if (!post.userpost.msg && (!post.userpost.rt || (post.userpost.rt && !post.userpost.rt.msg)))
return;
postToElem(postFromJson, 'original').hide().appendTo(elem).slideDown('fast');
postToElem(post, 'original').hide().appendTo(elem).slideDown('fast');
$.MAL.postboardLoaded();
}

View File

@ -346,11 +346,9 @@ function timelineChangedUser()
timelineLoaded = false;
}
function willBeHidden(post){
// posts without 'msg' may be used for metadata like 'url'
// and are not meant to be displayed.
if (typeof(post['userpost']['msg']) === 'undefined' &&
typeof(post['userpost']['rt']) === 'undefined' )
function willBeHidden(post) {
// posts without 'msg' and 'rt.msg' may be used for metadata like 'url' and are not meant to be displayed
if (!post.userpost.msg && (!post.userpost.rt || (post.userpost.rt && !post.userpost.rt.msg)))
return true;
if (post['userpost']['n'] === defaultScreenName)