From 992c8e1f7714d228a5e8e450cbe856eb41f6096d Mon Sep 17 00:00:00 2001 From: taehoon Date: Wed, 17 Apr 2019 22:47:56 -0400 Subject: [PATCH] stop fetching user relationship when user is unauthorized --- src/modules/users.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/users.js b/src/modules/users.js index a5dec794..c98e353a 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -224,8 +224,10 @@ const users = { }) }, fetchUserRelationship (store, id) { - return store.rootState.api.backendInteractor.fetchUserRelationship({ id }) - .then((relationships) => store.commit('updateUserRelationship', relationships)) + if (store.state.currentUser) { + store.rootState.api.backendInteractor.fetchUserRelationship({ id }) + .then((relationships) => store.commit('updateUserRelationship', relationships)) + } }, fetchBlocks (store) { return store.rootState.api.backendInteractor.fetchBlocks()