From c7655d442e8ff4dcf88d35c3316e931161714a8b Mon Sep 17 00:00:00 2001 From: MoHo Khaleqi Date: Wed, 14 Nov 2018 14:39:15 +0000 Subject: [PATCH] [BUG] #4 if user has no post, dont stuck there --- src/pages/PageProfile.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/PageProfile.vue b/src/pages/PageProfile.vue index 18ca4d0..3e946cc 100644 --- a/src/pages/PageProfile.vue +++ b/src/pages/PageProfile.vue @@ -56,7 +56,8 @@ } }, created () { - this.$store.dispatch('posts/fetchPosts', {ids: this.user.posts}) + const userPostsIds = this.user.posts || [] + this.$store.dispatch('posts/fetchPosts', {ids: userPostsIds}) .then(() => this.asyncDataStatus_fetched()) } }