From b3f391ee2054bc821d3b200c0f136650e68f8dc0 Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Sat, 8 Apr 2017 00:31:06 +0200 Subject: [PATCH 1/2] [fix][partial] External profil cards are not shown - https://git.gnu.io/h2p/Qvitter/issues/91 --- js/dom-functions.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/dom-functions.js b/js/dom-functions.js index 0c8388f..575225d 100644 --- a/js/dom-functions.js +++ b/js/dom-functions.js @@ -488,7 +488,6 @@ function buildProfileCard(data) { · · · · · · · · · */ function buildExternalProfileCard(data) { - // follows me? var follows_you = ''; if(data.local !== null && data.local.follows_you === true && window.loggedIn.id != data.local.id) { @@ -497,7 +496,7 @@ function buildExternalProfileCard(data) { // follow button var followButton = ''; - if(window.loggedIn !== false && typeof data.local != 'undefined' && data.local !== null) { + if(window.loggedIn !== false && typeof data.local != 'undefined' && data.local) { var followButton = buildFollowBlockbutton(data.local); } @@ -1037,7 +1036,7 @@ function setNewCurrentStream(streamObject,setLocation,fallbackId,actionOnSuccess } // add this stream to the history menu - addStreamToHistoryMenuAndMarkAsCurrent(streamObject); + addStreamToHistoryMenuAndMarkAsCurrent(streamObject); // profile card from user array if(userArray) { From d4c5c920ce310e9e1f58de23b6a86ff90899bbfd Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Sat, 8 Apr 2017 00:59:46 +0200 Subject: [PATCH 2/2] Fix : after profile are not updated by json --- js/qvitter.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/js/qvitter.js b/js/qvitter.js index e24eac0..85be898 100644 --- a/js/qvitter.js +++ b/js/qvitter.js @@ -285,7 +285,6 @@ $('body').on('mouseover',function (e) { possibleNickname = $(e.target).text(); } } - // see if we have it in cache, otherwise query server getUserArrayData(hrefAttr, possibleNickname, timeNow, targetElement, function(userArray, timeOut){ @@ -328,9 +327,8 @@ $('body').on('mouseover',function (e) { // we query it for the lastest data if((typeof window.userArrayLastRetrieved[hrefAttr] == 'undefined') || (timeNow - window.userArrayLastRetrieved[hrefAttr]) > 60000) { window.userArrayLastRetrieved[hrefAttr] = timeNow; - // local users - if(userArray.local !== null && userArray.local.is_local === true) { + if(userArray.local && userArray.local.is_local === true) { getFromAPI('users/show.json?id=' + userArray.local.screen_name, function(data){ if(data) { var newProfileCard = buildProfileCard(data); @@ -341,7 +339,7 @@ $('body').on('mouseover',function (e) { } // external users - else if(userArray.local === null || userArray.local.is_local === false) { + else if(!userArray.local || userArray.local.is_local === false) { getFromAPI('qvitter/external_user_show.json?profileurl=' + encodeURIComponent(hrefAttr),function(data){ if(data && data.external !== null) { var newProfileCard = buildExternalProfileCard(data);