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:
committed by
GitHub
parent
7181b38ec1
commit
2c79c4c620
@@ -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">
|
||||||
|
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user