mirror of
https://github.com/flarum/framework.git
synced 2025-03-02 01:18:56 +08: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:
parent
f0e96a0002
commit
e33c33a58f
7
framework/core/js/forum/dist/app.js
vendored
7
framework/core/js/forum/dist/app.js
vendored
@ -22689,9 +22689,11 @@ System.register('flarum/components/IndexPage', ['flarum/extend', 'flarum/compone
|
|||||||
className: 'Button Button--icon',
|
className: 'Button Button--icon',
|
||||||
onclick: function onclick() {
|
onclick: function onclick() {
|
||||||
app.cache.discussionList.refresh();
|
app.cache.discussionList.refresh();
|
||||||
|
if (app.session.user) {
|
||||||
app.store.find('users', app.session.user.id());
|
app.store.find('users', app.session.user.id());
|
||||||
m.redraw();
|
m.redraw();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (app.session.user) {
|
if (app.session.user) {
|
||||||
@ -28730,8 +28732,11 @@ System.register('flarum/initializers/boot', ['flarum/utils/ScrollListener', 'fla
|
|||||||
$('#home-link').click(function (e) {
|
$('#home-link').click(function (e) {
|
||||||
if (e.ctrlKey || e.metaKey || e.which === 2) return;
|
if (e.ctrlKey || e.metaKey || e.which === 2) return;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
app.store.find('users', app.session.user.id());
|
|
||||||
app.history.home();
|
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
|
// Add a class to the body which indicates that the page has been scrolled
|
||||||
|
@ -238,9 +238,11 @@ export default class IndexPage extends Page {
|
|||||||
className: 'Button Button--icon',
|
className: 'Button Button--icon',
|
||||||
onclick: () => {
|
onclick: () => {
|
||||||
app.cache.discussionList.refresh();
|
app.cache.discussionList.refresh();
|
||||||
|
if (app.session.user) {
|
||||||
app.store.find('users', app.session.user.id());
|
app.store.find('users', app.session.user.id());
|
||||||
m.redraw();
|
m.redraw();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -61,8 +61,11 @@ export default function boot(app) {
|
|||||||
$('#home-link').click(e => {
|
$('#home-link').click(e => {
|
||||||
if (e.ctrlKey || e.metaKey || e.which === 2) return;
|
if (e.ctrlKey || e.metaKey || e.which === 2) return;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
app.store.find('users', app.session.user.id());
|
|
||||||
app.history.home();
|
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
|
// Add a class to the body which indicates that the page has been scrolled
|
||||||
|
Loading…
x
Reference in New Issue
Block a user