Browse Source

fix some silly mistakes

readme-update
erqan 8 years ago
parent
commit
99f8940d38
  1. 8
      js/interface_common.js
  2. 16
      js/twister_following.js

8
js/interface_common.js

@ -783,16 +783,16 @@ function openNewUsersModal() { @@ -783,16 +783,16 @@ function openNewUsersModal() {
var hlist = $('<ol class="follow-suggestions"></ol>')
.appendTo(modal.content);
var count = 10;
var count = 15;
modal.content.on('scroll', function() {
if (modal.content.scrollTop() >= hlist.height() - modal.content.height() - 20) {
!getLastNUsers(5, count, modal.self);
count += 10;
if (getLastNUsers(5, count, modal.self))
count += 5;
}
});
getLastNUsers(10, 0, modal.self);
getLastNUsers(15, 0, modal.self);
}
function openModalUriShortener()

16
js/twister_following.js

@ -17,6 +17,7 @@ var _lastSearchUsersResultsRemovedFromDHTgetQueue = true; @@ -17,6 +17,7 @@ var _lastSearchUsersResultsRemovedFromDHTgetQueue = true;
var _lastLoadFromDhtTime = 0;
var _lastProcessedBlock = -1;
var knownNewUsers = [];
var isNewUserThRunning = false;
var twisterFollowingO = undefined;
@ -431,23 +432,34 @@ function followingEmptyOrMyself() { @@ -431,23 +432,34 @@ function followingEmptyOrMyself() {
function getLastNUsers(n,offset,module) {
if (isNewUserThRunning)
return false;
isNewUserThRunning = true;
for (var i = offset; i < knownNewUsers.length && i < offset + n; i++)
processWhoToFollowSuggestion(module, knownNewUsers[i]);
if (knownNewUsers.length >= n + offset)
return;
{
isNewUserThRunning = false;
return true;
}
if (_lastProcessedBlock == -1)
requestBestBlock(processBlockUsers, {n: n, offset: offset, module: module});
else
requestNthBlock(_lastProcessedBlock - 1, processBlockUsers, {n: n, offset: offset, module: module});
return true;
}
function processBlockUsers(block, users){
_lastProcessedBlock = block.height;
if (knownNewUsers.length + block.usernames.length < users.n + users.offset)
if (knownNewUsers.length + block.usernames.length < users.n + users.offset && typeof block.previousblockhash !== 'undefined')
setTimeout(function(){requestBlock(block.previousblockhash, processBlockUsers, users);}, 100);
else
isNewUserThRunning = false;
for (var i = 0; i < block.usernames.length; i++) {
if (knownNewUsers.indexOf(block.usernames[i]) == -1) {

Loading…
Cancel
Save