1
0
mirror of https://github.com/flarum/core.git synced 2025-07-22 09:11:19 +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() { view() {
const flags = this.state.cache; const flags = this.state.cache || [];
return ( return (
<div className="NotificationList FlagList"> <div className="NotificationList FlagList">

View File

@@ -8,8 +8,6 @@ export default class FlagListState {
* @type {Boolean} * @type {Boolean}
*/ */
this.loading = false; this.loading = false;
this.cache = [];
} }
/** /**
@@ -17,7 +15,7 @@ export default class FlagListState {
* been loaded. * been loaded.
*/ */
load() { load() {
if (this.cache.length && !this.app.session.user.attribute('newFlagCount')) { if (this.cache && !this.app.session.user.attribute('newFlagCount')) {
return; return;
} }