From ccea1755fc45e6c6b072f4a8898e319cf4a57179 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 15 Feb 2020 09:10:49 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=AA=E3=82=93=E3=81=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app.vue | 4 ++-- src/client/mios.ts | 1 - src/models/repositories/user.ts | 12 +++++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/client/app.vue b/src/client/app.vue index fb69e742ae..c97bd96834 100644 --- a/src/client/app.vue +++ b/src/client/app.vue @@ -63,7 +63,7 @@ {{ $t('followRequests') }} - +
@@ -137,7 +137,7 @@
- + diff --git a/src/client/mios.ts b/src/client/mios.ts index 0b94d331ea..3bf026af7f 100644 --- a/src/client/mios.ts +++ b/src/client/mios.ts @@ -227,7 +227,6 @@ export default class MiOS extends EventEmitter { // トークンが再生成されたとき // このままではMisskeyが利用できないので強制的にサインアウトさせる main.on('myTokenRegenerated', () => { - alert(locale['common']['my-token-regenerated']); this.signout(); }); } diff --git a/src/models/repositories/user.ts b/src/models/repositories/user.ts index 3b7563a0a8..4d96fbe95c 100644 --- a/src/models/repositories/user.ts +++ b/src/models/repositories/user.ts @@ -125,6 +125,14 @@ export class UserRepository extends Repository { return count > 0; } + public async getHasPendingReceivedFollowRequest(userId: User['id']): Promise { + const count = await FollowRequests.count({ + followeeId: userId + }); + + return count > 0; + } + public async pack( src: User['id'] | User, me?: User['id'] | User | null | undefined, @@ -226,9 +234,7 @@ export class UserRepository extends Repository { hasUnreadAntenna: this.getHasUnreadAntenna(user.id), hasUnreadMessagingMessage: this.getHasUnreadMessagingMessage(user.id), hasUnreadNotification: this.getHasUnreadNotification(user.id), - pendingReceivedFollowRequestsCount: FollowRequests.count({ - followeeId: user.id - }), + hasPendingReceivedFollowRequest: this.getHasPendingReceivedFollowRequest(user.id), integrations: profile!.integrations, } : {}),