The document JS payload attribute was previously renamed to apiDocument

This commit is contained in:
Toby Zerner 2018-09-30 09:24:25 +09:30
parent 692194ec7d
commit 083dcc3700
3 changed files with 6 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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