From 484d17f53f26ff3e8961d86f03ef94f62f8f62ed Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 2 Jun 2018 00:15:17 +0900 Subject: wip --- .../app/mobile/views/components/follow-button.vue | 49 ++++++++++++++-------- src/client/app/mobile/views/pages/user.vue | 1 - 2 files changed, 32 insertions(+), 18 deletions(-) (limited to 'src/client') diff --git a/src/client/app/mobile/views/components/follow-button.vue b/src/client/app/mobile/views/components/follow-button.vue index a6b5cf0556..9c363d7164 100644 --- a/src/client/app/mobile/views/components/follow-button.vue +++ b/src/client/app/mobile/views/components/follow-button.vue @@ -1,13 +1,16 @@ @@ -66,15 +69,27 @@ export default Vue.extend({ this.wait = false; }); } else { - (this as any).api('following/create', { - userId: this.user.id - }).then(() => { - this.user.isFollowing = true; - }).catch(err => { - console.error(err); - }).then(() => { - this.wait = false; - }); + if (this.user.isLocked && this.user.hasPendingFollowRequestFromYou) { + (this as any).api('following/requests/cancel', { + userId: this.user.id + }).then(() => { + this.user.hasPendingFollowRequestFromYou = false; + }).catch(err => { + console.error(err); + }).then(() => { + this.wait = false; + }); + } else { + (this as any).api('following/create', { + userId: this.user.id + }).then(() => { + this.user.isFollowing = true; + }).catch(err => { + console.error(err); + }).then(() => { + this.wait = false; + }); + } } } } @@ -90,11 +105,11 @@ export default Vue.extend({ cursor pointer padding 0 16px margin 0 - height inherit - font-size 16px + line-height 36px + font-size 14px outline none border solid 1px $theme-color - border-radius 4px + border-radius 36px * pointer-events none diff --git a/src/client/app/mobile/views/pages/user.vue b/src/client/app/mobile/views/pages/user.vue index b3b820650c..3d37015906 100644 --- a/src/client/app/mobile/views/pages/user.vue +++ b/src/client/app/mobile/views/pages/user.vue @@ -184,7 +184,6 @@ root(isDark) > .mk-follow-button float right - height 40px > .title margin 8px 0 -- cgit v1.2.3-freya