mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
Improve logic to see if post has been fully loaded
Should fix #295 once and for all.
This commit is contained in:
parent
aeeb16cb86
commit
aea8b17175
|
@ -179,7 +179,7 @@ class PostStream extends Component {
|
||||||
.map(id => {
|
.map(id => {
|
||||||
const post = app.store.getById('posts', id);
|
const post = app.store.getById('posts', id);
|
||||||
|
|
||||||
return post && post.discussion() && post.canEdit() !== null ? post : null;
|
return post && post.discussion() && typeof post.canEdit() !== 'undefined' ? post : null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ class PostStream extends Component {
|
||||||
this.discussion.postIds().slice(start, end).forEach(id => {
|
this.discussion.postIds().slice(start, end).forEach(id => {
|
||||||
const post = app.store.getById('posts', id);
|
const post = app.store.getById('posts', id);
|
||||||
|
|
||||||
if (post && post.discussion()) {
|
if (post && post.discussion() && typeof post.canEdit() !== 'undefined') {
|
||||||
loaded.push(post);
|
loaded.push(post);
|
||||||
} else {
|
} else {
|
||||||
loadIds.push(id);
|
loadIds.push(id);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user