Merge pull request #1402 from LaunchAcademy/fix_index_out_of_range_error

FIX: Index out of range error
This commit is contained in:
Robin Ward 2013-09-06 11:53:59 -07:00
commit b62caf80fb

View file

@ -345,7 +345,7 @@ Discourse.User.reopenClass(Discourse.Singleton, {
var result = Em.A();
result.pushObjects(stats.rejectProperty('isResponse'));
var insertAt = 1;
var insertAt = 0;
result.forEach(function(item, index){
if(item.action_type === Discourse.UserAction.TYPES.topics || item.action_type === Discourse.UserAction.TYPES.posts){
insertAt = index + 1;