1
0
mirror of https://github.com/flarum/core.git synced 2025-10-27 05:31:29 +01:00

Move Discussion List State into its own class (#2150)

Extract discussion list state
This commit is contained in:
Alexander Skvortsov
2020-06-18 19:53:40 -04:00
committed by GitHub
parent c5d3b058ba
commit 5c1663d8f1
9 changed files with 230 additions and 204 deletions

View File

@@ -181,10 +181,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.postIds().length) {
// If there is a discussion list in the cache, remove this discussion.
if (app.cache.discussionList) {
app.cache.discussionList.removeDiscussion(discussion);
}
app.discussions.removeDiscussion(discussion);
if (app.viewingDiscussion(discussion)) {
app.history.back();