mirror of
https://github.com/flarum/framework.git
synced 2024-12-03 15:43:59 +08:00
The document JS payload attribute was previously renamed to apiDocument
This commit is contained in:
parent
692194ec7d
commit
083dcc3700
|
@ -185,11 +185,11 @@ export default class Application {
|
|||
* @return {Object|null}
|
||||
* @public
|
||||
*/
|
||||
preloadedDocument() {
|
||||
if (this.data.document) {
|
||||
const results = this.store.pushPayload(this.data.document);
|
||||
preloadedApiDocument() {
|
||||
if (this.data.apiDocument) {
|
||||
const results = this.store.pushPayload(this.data.apiDocument);
|
||||
|
||||
this.data.document = null;
|
||||
this.data.apiDocument = null;
|
||||
|
||||
return results;
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ export default class DiscussionList extends Component {
|
|||
* @return {Promise}
|
||||
*/
|
||||
loadResults(offset) {
|
||||
const preloadedDiscussions = app.preloadedDocument();
|
||||
const preloadedDiscussions = app.preloadedApiDocument();
|
||||
|
||||
if (preloadedDiscussions) {
|
||||
return m.deferred().resolve(preloadedDiscussions).promise;
|
||||
|
|
|
@ -130,7 +130,7 @@ export default class DiscussionPage extends Page {
|
|||
this.near = m.route.param('near') || 0;
|
||||
this.discussion = null;
|
||||
|
||||
const preloadedDiscussion = app.preloadedDocument();
|
||||
const preloadedDiscussion = app.preloadedApiDocument();
|
||||
if (preloadedDiscussion) {
|
||||
// We must wrap this in a setTimeout because if we are mounting this
|
||||
// component for the first time on page load, then any calls to m.redraw
|
||||
|
|
Loading…
Reference in New Issue
Block a user