mirror of
https://github.com/flarum/core.git
synced 2025-05-06 07:25:22 +02: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
5385c79a2b
commit
01f3a7dc01
@ -55,7 +55,6 @@ export default Ember.ArrayProxy.extend(Ember.Evented, {
|
|||||||
|
|
||||||
loadRange: function(start, end, backwards) {
|
loadRange: function(start, end, backwards) {
|
||||||
var limit = this.get('postLoadCount');
|
var limit = this.get('postLoadCount');
|
||||||
end = end || start + limit;
|
|
||||||
|
|
||||||
// Find the appropriate gap objects in the post stream. When we find
|
// Find the appropriate gap objects in the post stream. When we find
|
||||||
// one, we will turn on its loading flag.
|
// 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.
|
// request.) Or, if it's a gap, we'll switch on its loading flag.
|
||||||
var item = this.findNearestToNumber(number);
|
var item = this.findNearestToNumber(number);
|
||||||
if (item) {
|
if (item) {
|
||||||
if (item.get('content.number') === number) {
|
if (item.get('content.number') == number) {
|
||||||
return Ember.RSVP.resolve([item.get('content')]);
|
return Ember.RSVP.resolve([item.get('content')]);
|
||||||
} else if (item.gap) {
|
} else if (item.gap) {
|
||||||
item.set('direction', 'down').set('loading', true);
|
item.set('direction', 'down').set('loading', true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user