1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 23:44:27 +02:00

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
3 changed files with 16 additions and 6 deletions

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