mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 08:39:25 +08:00
Show composer after discussion is reloaded following login
This commit is contained in:
parent
8b7e7c0afd
commit
96c3c2cc25
@ -11,8 +11,10 @@ import LoadingIndicator from 'flarum/components/loading-indicator';
|
||||
import DropdownSplit from 'flarum/components/dropdown-split';
|
||||
import Separator from 'flarum/components/separator';
|
||||
import listItems from 'flarum/helpers/list-items';
|
||||
import mixin from 'flarum/utils/mixin';
|
||||
import evented from 'flarum/utils/evented';
|
||||
|
||||
export default class DiscussionPage extends Component {
|
||||
export default class DiscussionPage extends mixin(Component, evented) {
|
||||
/**
|
||||
|
||||
*/
|
||||
@ -102,6 +104,8 @@ export default class DiscussionPage extends Component {
|
||||
this.streamContent.goToNumber(this.currentNear, true);
|
||||
|
||||
app.setTitle(discussion.title());
|
||||
|
||||
this.trigger('loaded');
|
||||
}
|
||||
|
||||
onload(element, isInitialized, context) {
|
||||
|
@ -25,7 +25,7 @@ export default function(app) {
|
||||
} else if (!app.session.user()) {
|
||||
app.modal.show(new LoginModal({
|
||||
message: 'You must be logged in to do that.',
|
||||
callback: this.replyAction.bind(this)
|
||||
callback: () => app.current.one('loaded', this.replyAction.bind(this, goToLast, forceRefresh))
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,17 @@ export default {
|
||||
this.getHandlers(event).push(handler);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
one(event, handler) {
|
||||
var wrapper = function() {
|
||||
handler.apply(this, arguments);
|
||||
this.off(event, wrapper);
|
||||
};
|
||||
this.getHandlers(event).push(wrapper);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user