framework/js/lib/initializers/preload.js
Toby Zerner 99876e9e36 Initial refactor of client actions, data preloading, SEO
An initial stab at flarum/core#126. Still WIP. Preliminary
implementation of flarum/core#128 and flarum/core#13.
2015-07-07 15:29:21 +09:30

10 lines
292 B
JavaScript

export default function(app) {
app.store.pushPayload({data: app.preload.data});
app.forum = app.store.getById('forums', 1);
if (app.preload.session) {
app.session.token(app.preload.session.token);
app.session.user(app.store.getById('users', app.preload.session.userId));
}
}