mirror of
https://github.com/flarum/framework.git
synced 2025-03-25 08:17:29 +08:00
Don't initialize cache until we receive flags (#31)
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user