Fix pinned pane broken after discussion creation

The pane would appear but the page content would not shift to the right because the hasPane className would be missing
This commit is contained in:
Clark Winkelmann 2022-02-21 19:38:23 +01:00 committed by Daniël Klabbers
parent ef6040a0a8
commit 186e8be026
2 changed files with 4 additions and 2 deletions

View File

@ -101,7 +101,7 @@ export default class DiscussionComposer extends ComposerBody {
.save(data)
.then((discussion) => {
this.composer.hide();
app.discussions.refresh({ deferClear: true });
app.discussions.refresh();
m.route.set(app.route.discussion(discussion));
}, this.loaded.bind(this));
}

View File

@ -53,7 +53,9 @@ export default class DiscussionPage<CustomAttrs extends IDiscussionPageAttrs = I
// page, then we don't want Mithril to redraw the whole page if it did,
// then the pane would redraw which would be slow and would cause problems with
// event handlers.
if (app.discussions.hasItems()) {
// We will also enable the pane if the discussion list is empty but loading,
// because the DiscussionComposer refreshes the list and redirects to the new discussion at the same time.
if (app.discussions.hasItems() || app.discussions.isLoading()) {
app.pane?.enable();
app.pane?.hide();
}