diff --git a/js/dom-functions.js b/js/dom-functions.js index d7f2cbb..156344f 100644 --- a/js/dom-functions.js +++ b/js/dom-functions.js @@ -361,21 +361,19 @@ function buildProfileCard(data) { var followButton = ''; - // only add follow button if this is a local user - if(data.is_local == true) { - if(typeof window.loggedIn.screen_name != 'undefined' && window.loggedIn.id != data.id) { - followButton = buildFollowBlockbutton(data); - } + // follow from external instance if logged out and the user is local + if(window.loggedIn === false && data.is_local == true) { + followButton = '
'; + } - // follow from external instance if logged out - if(typeof window.loggedIn.screen_name == 'undefined') { - followButton = ''; - } + // edit profile button if it's me + else if(window.loggedIn !== false && window.loggedIn.id == data.id) { + followButton = ''; + } - // edit profile button if me - if(typeof window.loggedIn.screen_name != 'undefined' && window.loggedIn.id == data.id) { - followButton = ''; - } + // follow button for logged in users + else if(window.loggedIn !== false) { + followButton = buildFollowBlockbutton(data); } // is webpage empty?