diff --git a/components/mixins/blacklistable.js b/components/mixins/blacklistable.js index 8adfe95c..59528c2e 100644 --- a/components/mixins/blacklistable.js +++ b/components/mixins/blacklistable.js @@ -6,7 +6,8 @@ export default { blacklistPending: 'feathers-vuex-usersettings/isPending' }), isBlacklisted () { - return this.currentUserSettings.blacklist.includes(this.author()._id) + let { blacklist } = this.currentUserSettings + return blacklist && blacklist.includes(this.author()._id) } }, methods: { diff --git a/pages/auth/settings/blacklist.vue b/pages/auth/settings/blacklist.vue index 9dd103bf..c942ea8b 100644 --- a/pages/auth/settings/blacklist.vue +++ b/pages/auth/settings/blacklist.vue @@ -24,8 +24,9 @@ import Author from '~/components/Author/Author.vue' } }, async asyncData ({store}) { - const currentUserSettings = store.getters['feathers-vuex-usersettings/current']; - const res = await store.dispatch('feathers-vuex-users/find', { query: {_id: { $in: currentUserSettings.blacklist } } } ); + const { blacklist } = store.getters['feathers-vuex-usersettings/current']; + if (!blacklist) return {} + const res = await store.dispatch('feathers-vuex-users/find', { query: {_id: { $in: blacklist } } } ); return { blacklistedUsers: res.data }