mirror of
https://github.com/flarum/core.git
synced 2025-07-21 16:51:34 +02:00
Don't initialize cache until we receive flags (#31)
This commit is contained in:
committed by
GitHub
parent
7181b38ec1
commit
2c79c4c620
@@ -13,7 +13,7 @@ export default class FlagList extends Component {
|
||||
}
|
||||
|
||||
view() {
|
||||
const flags = this.state.cache;
|
||||
const flags = this.state.cache || [];
|
||||
|
||||
return (
|
||||
<div className="NotificationList FlagList">
|
||||
|
@@ -8,8 +8,6 @@ export default class FlagListState {
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this.loading = false;
|
||||
|
||||
this.cache = [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -17,7 +15,7 @@ export default class FlagListState {
|
||||
* been loaded.
|
||||
*/
|
||||
load() {
|
||||
if (this.cache.length && !this.app.session.user.attribute('newFlagCount')) {
|
||||
if (this.cache && !this.app.session.user.attribute('newFlagCount')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user