From 44cfe9b32264d366d056bcba02f8942a379ea99c Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Fri, 31 Jan 2020 15:45:19 +0900
Subject: [PATCH] Fix bug

---
 src/client/components/follow-button.vue | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/client/components/follow-button.vue b/src/client/components/follow-button.vue
index 6ebe9db9e..23cb0cd94 100644
--- a/src/client/components/follow-button.vue
+++ b/src/client/components/follow-button.vue
@@ -3,6 +3,7 @@
 	:class="{ wait, active: isFollowing || hasPendingFollowRequestFromYou, full }"
 	@click="onClick"
 	:disabled="wait"
+	v-if="isFollowing != null"
 >
 	<template v-if="!wait">
 		<template v-if="hasPendingFollowRequestFromYou && user.isLocked">
@@ -57,6 +58,18 @@ export default Vue.extend({
 		};
 	},
 
+	created() {
+		// 渡されたユーザー情報が不完全な場合
+		if (this.user.isFollowing == null) {
+			this.$root.api('users/show', {
+				userId: this.user.id
+			}).then(u => {
+				this.isFollowing = u.isFollowing;
+				this.hasPendingFollowRequestFromYou = u.hasPendingFollowRequestFromYou;
+			});
+		}
+	},
+
 	mounted() {
 		this.connection = this.$root.stream.useSharedConnection('main');