1
0
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:
Alexander Skvortsov
2020-10-25 01:31:07 -04:00
committed by GitHub
parent 7181b38ec1
commit 2c79c4c620
2 changed files with 2 additions and 4 deletions

View File

@@ -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">

View File

@@ -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;
}