mirror of
https://github.com/flarum/framework.git
synced 2025-06-04 23:14:32 +08:00
Fix regressions related to deleting posts
- On the front-end, correct the check to see if the discussion has no more posts - On the back-end, run a query to count the posts instead of using the comments_count, because the comments_count does not include other deleted posts
This commit is contained in:
2
js/forum/dist/app.js
vendored
2
js/forum/dist/app.js
vendored
@ -33899,7 +33899,7 @@ System.register('flarum/utils/PostControls', ['flarum/components/EditPostCompose
|
||||
|
||||
// If this was the last post in the discussion, then we will assume that
|
||||
// the whole discussion was deleted too.
|
||||
if (!discussion.posts.length) {
|
||||
if (!discussion.postIds().length) {
|
||||
// If there is a discussion list in the cache, remove this discussion.
|
||||
if (app.cache.discussionList) {
|
||||
app.cache.discussionList.removeDiscussion(discussion);
|
||||
|
@ -155,7 +155,7 @@ export default {
|
||||
|
||||
// If this was the last post in the discussion, then we will assume that
|
||||
// the whole discussion was deleted too.
|
||||
if (!discussion.posts.length) {
|
||||
if (!discussion.postIds().length) {
|
||||
// If there is a discussion list in the cache, remove this discussion.
|
||||
if (app.cache.discussionList) {
|
||||
app.cache.discussionList.removeDiscussion(discussion);
|
||||
|
Reference in New Issue
Block a user