diff --git a/packages/frontend/src/components/MkUserSelectDialog.vue b/packages/frontend/src/components/MkUserSelectDialog.vue index 1846361108..7bef0a6e73 100644 --- a/packages/frontend/src/components/MkUserSelectDialog.vue +++ b/packages/frontend/src/components/MkUserSelectDialog.vue @@ -101,7 +101,13 @@ function search() { limit: 10, detail: false, }).then(_users => { - users.value = _users; + users.value = _users.filter((u) => { + if (props.includeSelf === false) { + return u.id !== $i?.id; + } else { + return true; + } + }); }); } @@ -131,18 +137,22 @@ onMounted(() => { misskeyApi('users/show', { userIds: defaultStore.state.recentlyUsedUsers, }).then(foundUsers => { - const _users = foundUsers.filter((u) => { + let _users = foundUsers; + _users = _users.filter((u) => { if (props.localOnly) { return u.host == null; } else { return true; } }); - if (props.includeSelf && _users.find(x => $i ? x.id === $i.id : true) == null) { - recentUsers.value = [$i!, ..._users]; - } else { - recentUsers.value = _users; - } + _users = _users.filter((u) => { + if (props.includeSelf === false) { + return u.id !== $i?.id; + } else { + return true; + } + }); + recentUsers.value = _users; }); }); diff --git a/packages/frontend/src/pages/reversi/index.vue b/packages/frontend/src/pages/reversi/index.vue index fca9f9e643..f342c986fc 100644 --- a/packages/frontend/src/pages/reversi/index.vue +++ b/packages/frontend/src/pages/reversi/index.vue @@ -196,7 +196,7 @@ async function matchHeatbeat() { async function matchUser() { pleaseLogin(); - const user = await os.selectUser({ localOnly: true }); + const user = await os.selectUser({ includeSelf: false, localOnly: true }); if (user == null) return; matchingUser.value = user;