fixing silliness (2)

This commit is contained in:
erqan 2016-11-24 19:02:44 +03:00
parent 46d6264743
commit a303cce847

View File

@ -524,17 +524,26 @@ NewUserSearch.prototype = {
this.isForced = false; this.isForced = false;
} }
for (var i = 0; i < block.usernames.length; i++) { var i = 0;
for (; i < block.usernames.length; i++) {
if (NewUserSearch.knownNewUsers.indexOf(block.usernames[i]) == -1) { if (NewUserSearch.knownNewUsers.indexOf(block.usernames[i]) == -1) {
processWhoToFollowSuggestion(args.args.module, block.usernames[i], undefined, args.args.prepend); processWhoToFollowSuggestion(args.args.module, block.usernames[i], undefined, args.args.prepend);
if (args.args.prepend)
NewUserSearch.knownNewUsers.unshift(block.usernames[i]);
else
NewUserSearch.knownNewUsers.push(block.usernames[i]);
if (!args.args.live && NewUserSearch.knownNewUsers.length >= args.args.n + args.args.offset) if (!args.args.live && NewUserSearch.knownNewUsers.length >= args.args.n + args.args.offset)
break; break;
} }
} }
for (; i < block.usernames.length; i++) {
if (NewUserSearch.knownNewUsers.indexOf(block.usernames[i]) == -1) {
if (args.args.prepend) if (args.args.prepend)
NewUserSearch.knownNewUsers.unshift(block.usernames); NewUserSearch.knownNewUsers.unshift(block.usernames[i]);
else else
NewUserSearch.knownNewUsers.push(block.usernames); NewUserSearch.knownNewUsers.push(block.usernames[i]);
}
}
this.save(); this.save();
} }