From 6a41afaaeedce1a0530eaa5835c798181f220070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Tue, 30 Jan 2024 20:54:30 +0900 Subject: [PATCH] =?UTF-8?q?fix/refactor(reversi):=20=E6=97=A2=E5=AD=98?= =?UTF-8?q?=E3=81=AE=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3=E3=83=BB?= =?UTF-8?q?=E5=9E=8B=E5=AE=9A=E7=BE=A9=E3=82=92=E5=BC=B7=E5=8C=96=20(#1310?= =?UTF-8?q?5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 既存のバグを修正 * fix types * fix misskey-js autogen * Update index.d.ts --------- Co-authored-by: syuilo --- locales/index.d.ts | 2 +- .../src/components/MkUserSelectDialog.vue | 28 +++++-- packages/frontend/src/os.ts | 3 +- .../frontend/src/pages/reversi/game.board.vue | 21 ++--- packages/frontend/src/pages/reversi/index.vue | 7 +- packages/misskey-js/etc/misskey-js.api.md | 40 ++++++++++ .../misskey-js/src/autogen/apiClientJSDoc.ts | 2 +- packages/misskey-js/src/autogen/endpoint.ts | 2 +- packages/misskey-js/src/autogen/entities.ts | 2 +- packages/misskey-js/src/autogen/models.ts | 2 +- packages/misskey-js/src/autogen/types.ts | 2 +- packages/misskey-js/src/streaming.types.ts | 27 +++++++ pnpm-lock.yaml | 80 ++++++++++--------- 13 files changed, 153 insertions(+), 65 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 966c2224fb..f8c4971655 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -4894,7 +4894,7 @@ export interface Locale extends ILocale { */ "readConfirmText": ParameterizedString<"title">; /** - * 特に新規ユーザーのUXを損ねる可能性が高いため、ストック情報ではなくフロー情報の掲示にお知らせを使用することを推奨します。 + * 特に新規ユーザーのUXを損ねる可能性が高いため、常時掲示するための情報ではなく、即時性が求められる情報の掲示のためにお知らせを使用することを推奨します。 */ "shouldNotBeUsedToPresentPermanentInfo": string; /** diff --git a/packages/frontend/src/components/MkUserSelectDialog.vue b/packages/frontend/src/components/MkUserSelectDialog.vue index d7bd73aa8a..1846361108 100644 --- a/packages/frontend/src/components/MkUserSelectDialog.vue +++ b/packages/frontend/src/components/MkUserSelectDialog.vue @@ -16,7 +16,11 @@ SPDX-License-Identifier: AGPL-3.0-only
- + + + + + @@ -66,7 +70,7 @@ import { misskeyApi } from '@/scripts/misskey-api.js'; import { defaultStore } from '@/store.js'; import { i18n } from '@/i18n.js'; import { $i } from '@/account.js'; -import { hostname } from '@/config.js'; +import { host as currentHost, hostname } from '@/config.js'; const emit = defineEmits<{ (ev: 'ok', selected: Misskey.entities.UserDetailed): void; @@ -76,6 +80,7 @@ const emit = defineEmits<{ const props = defineProps<{ includeSelf?: boolean; + localOnly?: boolean; }>(); const username = ref(''); @@ -92,7 +97,7 @@ function search() { } misskeyApi('users/search-by-username-and-host', { username: username.value, - host: host.value, + host: props.localOnly ? '.' : host.value, limit: 10, detail: false, }).then(_users => { @@ -125,11 +130,18 @@ function cancel() { onMounted(() => { misskeyApi('users/show', { userIds: defaultStore.state.recentlyUsedUsers, - }).then(users => { - if (props.includeSelf && users.find(x => $i ? x.id === $i.id : true) == null) { - recentUsers.value = [$i!, ...users]; + }).then(foundUsers => { + const _users = foundUsers.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; + recentUsers.value = _users; } }); }); @@ -138,7 +150,7 @@ onMounted(() => {