Fixed error when user is not logged in; fixed notification count not updating when clicking home link (added m.redraw)

This commit is contained in:
David Sevilla Martin 2016-08-30 10:35:31 -04:00
parent 2c5aa138cd
commit 592dd6a927
No known key found for this signature in database
GPG Key ID: 5E58124CB6615509
3 changed files with 16 additions and 6 deletions

11
js/forum/dist/app.js vendored
View File

@ -22689,8 +22689,10 @@ System.register('flarum/components/IndexPage', ['flarum/extend', 'flarum/compone
className: 'Button Button--icon',
onclick: function onclick() {
app.cache.discussionList.refresh();
app.store.find('users', app.session.user.id());
m.redraw();
if (app.session.user) {
app.store.find('users', app.session.user.id());
m.redraw();
}
}
}));
@ -28730,8 +28732,11 @@ System.register('flarum/initializers/boot', ['flarum/utils/ScrollListener', 'fla
$('#home-link').click(function (e) {
if (e.ctrlKey || e.metaKey || e.which === 2) return;
e.preventDefault();
app.store.find('users', app.session.user.id());
app.history.home();
if (app.session.user) {
app.store.find('users', app.session.user.id());
m.redraw();
}
});
// Add a class to the body which indicates that the page has been scrolled

View File

@ -238,8 +238,10 @@ export default class IndexPage extends Page {
className: 'Button Button--icon',
onclick: () => {
app.cache.discussionList.refresh();
app.store.find('users', app.session.user.id());
m.redraw();
if (app.session.user) {
app.store.find('users', app.session.user.id());
m.redraw();
}
}
})
);

View File

@ -61,8 +61,11 @@ export default function boot(app) {
$('#home-link').click(e => {
if (e.ctrlKey || e.metaKey || e.which === 2) return;
e.preventDefault();
app.store.find('users', app.session.user.id());
app.history.home();
if (app.session.user) {
app.store.find('users', app.session.user.id());
m.redraw();
}
});
// Add a class to the body which indicates that the page has been scrolled