diff --git a/src/client/app.vue b/src/client/app.vue index fb69e742a..c97bd9683 100644 --- a/src/client/app.vue +++ b/src/client/app.vue @@ -63,7 +63,7 @@ </router-link> <router-link class="item" active-class="active" to="/my/follow-requests" v-if="$store.getters.isSignedIn && $store.state.i.isLocked"> <fa :icon="faUserClock" fixed-width/><span class="text">{{ $t('followRequests') }}</span> - <i v-if="$store.state.i.pendingReceivedFollowRequestsCount"><fa :icon="faCircle"/></i> + <i v-if="$store.state.i.hasPendingReceivedFollowRequest"><fa :icon="faCircle"/></i> </router-link> <div class="divider"></div> <router-link class="item" active-class="active" to="/featured"> @@ -137,7 +137,7 @@ </div> <div class="buttons"> - <button v-if="$store.getters.isSignedIn" class="button nav _button" @click="showNav = true" ref="navButton"><fa :icon="faBars"/><i v-if="$store.state.i.hasUnreadSpecifiedNotes || $store.state.i.pendingReceivedFollowRequestsCount || $store.state.i.hasUnreadMessagingMessage || $store.state.i.hasUnreadAnnouncement"><fa :icon="faCircle"/></i></button> + <button v-if="$store.getters.isSignedIn" class="button nav _button" @click="showNav = true" ref="navButton"><fa :icon="faBars"/><i v-if="$store.state.i.hasUnreadSpecifiedNotes || $store.state.i.hasPendingReceivedFollowRequest || $store.state.i.hasUnreadMessagingMessage || $store.state.i.hasUnreadAnnouncement"><fa :icon="faCircle"/></i></button> <button v-if="$store.getters.isSignedIn" class="button home _button" :disabled="$route.path === '/'" @click="$router.push('/')"><fa :icon="faHome"/></button> <button v-if="$store.getters.isSignedIn" class="button notifications _button" @click="notificationsOpen = !notificationsOpen" ref="notificationButton2"><fa :icon="notificationsOpen ? faTimes : faBell"/><i v-if="$store.state.i.hasUnreadNotification"><fa :icon="faCircle"/></i></button> <button v-if="$store.getters.isSignedIn" class="button post _buttonPrimary" @click="post()"><fa :icon="faPencilAlt"/></button> diff --git a/src/client/mios.ts b/src/client/mios.ts index 0b94d331e..3bf026af7 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 3b7563a0a..4d96fbe95 100644 --- a/src/models/repositories/user.ts +++ b/src/models/repositories/user.ts @@ -125,6 +125,14 @@ export class UserRepository extends Repository<User> { return count > 0; } + public async getHasPendingReceivedFollowRequest(userId: User['id']): Promise<boolean> { + 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<User> { 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, } : {}),