mirror of
https://github.com/flarum/framework.git
synced 2024-11-26 18:33:40 +08:00
Fix bug when loading a single post at the start
When loading a single post at the start of a discussion, start=0 and end=0. But end would be set to start+limit, which was incorrect.
This commit is contained in:
parent
37fa92e868
commit
c1c6a27dc5
|
@ -55,7 +55,6 @@ export default Ember.ArrayProxy.extend(Ember.Evented, {
|
|||
|
||||
loadRange: function(start, end, backwards) {
|
||||
var limit = this.get('postLoadCount');
|
||||
end = end || start + limit;
|
||||
|
||||
// Find the appropriate gap objects in the post stream. When we find
|
||||
// one, we will turn on its loading flag.
|
||||
|
@ -93,7 +92,7 @@ export default Ember.ArrayProxy.extend(Ember.Evented, {
|
|||
// request.) Or, if it's a gap, we'll switch on its loading flag.
|
||||
var item = this.findNearestToNumber(number);
|
||||
if (item) {
|
||||
if (item.get('content.number') === number) {
|
||||
if (item.get('content.number') == number) {
|
||||
return Ember.RSVP.resolve([item.get('content')]);
|
||||
} else if (item.gap) {
|
||||
item.set('direction', 'down').set('loading', true);
|
||||
|
|
Loading…
Reference in New Issue
Block a user