mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
Make app.composer.show redraw synchronous, implement promises in reply, edit, and new discussion actions properly
This commit is contained in:
committed by
Franz Liedke
parent
f1a480d3d7
commit
0341e64057
@@ -296,16 +296,18 @@ export default class IndexPage extends Page {
|
|||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
newDiscussionAction() {
|
newDiscussionAction() {
|
||||||
if (app.session.user) {
|
return new Promise((resolve, reject) => {
|
||||||
app.composer.load(DiscussionComposer, { user: app.session.user });
|
if (app.session.user) {
|
||||||
app.composer.show();
|
app.composer.load(DiscussionComposer, { user: app.session.user });
|
||||||
|
app.composer.show();
|
||||||
|
|
||||||
return Promise.resolve(app.composer);
|
return resolve(app.composer);
|
||||||
} else {
|
} else {
|
||||||
app.modal.show(LogInModal);
|
app.modal.show(LogInModal);
|
||||||
|
|
||||||
return Promise.reject();
|
return reject();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -82,7 +82,7 @@ class ComposerState {
|
|||||||
if (this.position === ComposerState.Position.NORMAL || this.position === ComposerState.Position.FULLSCREEN) return;
|
if (this.position === ComposerState.Position.NORMAL || this.position === ComposerState.Position.FULLSCREEN) return;
|
||||||
|
|
||||||
this.position = ComposerState.Position.NORMAL;
|
this.position = ComposerState.Position.NORMAL;
|
||||||
m.redraw(true);
|
m.redraw.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -136,10 +136,12 @@ export default {
|
|||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
editAction() {
|
editAction() {
|
||||||
app.composer.load(EditPostComposer, { post: this });
|
return new Promise((resolve) => {
|
||||||
app.composer.show();
|
app.composer.load(EditPostComposer, { post: this });
|
||||||
|
app.composer.show();
|
||||||
|
|
||||||
return Promise.resolve(app.composer);
|
return resolve()
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user