From 430290c0843ef4d20c382f433c866a0b6f0e6f60 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: Fri, 2 Feb 2024 16:49:09 +0900 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20selectUser=E3=81=AE=E3=83=91?= =?UTF-8?q?=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E3=82=92=E8=AA=BF=E6=95=B4?= =?UTF-8?q?=20(#13142)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(frontend): selectUserのパラメータを調整 * ついでに軽微なスタイルの修正 --- .../src/components/MkAutocomplete.vue | 2 +- .../frontend/src/components/MkMediaVideo.vue | 1 + .../frontend/src/components/MkPostForm.vue | 2 +- .../src/components/MkUserSelectDialog.vue | 19 +++++++++++-------- .../src/pages/admin/proxy-account.vue | 2 +- .../frontend/src/pages/admin/roles.role.vue | 4 +--- packages/frontend/src/pages/admin/users.vue | 2 +- .../frontend/src/pages/my-antennas/editor.vue | 2 +- packages/frontend/src/pages/search.note.vue | 4 ++-- 9 files changed, 20 insertions(+), 18 deletions(-) diff --git a/packages/frontend/src/components/MkAutocomplete.vue b/packages/frontend/src/components/MkAutocomplete.vue index 9d03eab2cb..a428d85c76 100644 --- a/packages/frontend/src/components/MkAutocomplete.vue +++ b/packages/frontend/src/components/MkAutocomplete.vue @@ -431,7 +431,7 @@ function applySelect() { function chooseUser() { props.close(); - os.selectUser().then(user => { + os.selectUser({ includeSelf: true }).then(user => { complete('user', user); props.textarea.focus(); }); diff --git a/packages/frontend/src/components/MkMediaVideo.vue b/packages/frontend/src/components/MkMediaVideo.vue index e1ad5f0ce3..09f81c707e 100644 --- a/packages/frontend/src/components/MkMediaVideo.vue +++ b/packages/frontend/src/components/MkMediaVideo.vue @@ -396,6 +396,7 @@ onDeactivated(() => { .hidden { width: 100%; + height: 100%; background: #000; border: none; outline: none; diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 47904a9acb..d6ee1bc309 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -860,7 +860,7 @@ function cancel() { } function insertMention() { - os.selectUser().then(user => { + os.selectUser({ localOnly: localOnly.value, includeSelf: true }).then(user => { insertTextAtCursor(textareaEl.value, '@' + Misskey.acct.toString(user) + ' '); }); } diff --git a/packages/frontend/src/components/MkUserSelectDialog.vue b/packages/frontend/src/components/MkUserSelectDialog.vue index 7bef0a6e73..740b122fac 100644 --- a/packages/frontend/src/components/MkUserSelectDialog.vue +++ b/packages/frontend/src/components/MkUserSelectDialog.vue @@ -78,10 +78,13 @@ const emit = defineEmits<{ (ev: 'closed'): void; }>(); -const props = defineProps<{ +const props = withDefaults(defineProps<{ includeSelf?: boolean; localOnly?: boolean; -}>(); +}>(), { + includeSelf: false, + localOnly: false, +}); const username = ref(''); const host = ref(''); @@ -102,10 +105,10 @@ function search() { detail: false, }).then(_users => { users.value = _users.filter((u) => { - if (props.includeSelf === false) { - return u.id !== $i?.id; - } else { + if (props.includeSelf) { return true; + } else { + return u.id !== $i?.id; } }); }); @@ -146,10 +149,10 @@ onMounted(() => { } }); _users = _users.filter((u) => { - if (props.includeSelf === false) { - return u.id !== $i?.id; - } else { + if (props.includeSelf) { return true; + } else { + return u.id !== $i?.id; } }); recentUsers.value = _users; diff --git a/packages/frontend/src/pages/admin/proxy-account.vue b/packages/frontend/src/pages/admin/proxy-account.vue index 8b1b3280f3..a95bc8b8f9 100644 --- a/packages/frontend/src/pages/admin/proxy-account.vue +++ b/packages/frontend/src/pages/admin/proxy-account.vue @@ -45,7 +45,7 @@ async function init() { } function chooseProxyAccount() { - os.selectUser().then(user => { + os.selectUser({ localOnly: true }).then(user => { proxyAccount.value = user; proxyAccountId.value = user.id; save(); diff --git a/packages/frontend/src/pages/admin/roles.role.vue b/packages/frontend/src/pages/admin/roles.role.vue index 0460429ab2..8d39d96436 100644 --- a/packages/frontend/src/pages/admin/roles.role.vue +++ b/packages/frontend/src/pages/admin/roles.role.vue @@ -116,9 +116,7 @@ async function del() { } async function assign() { - const user = await os.selectUser({ - includeSelf: true, - }); + const user = await os.selectUser({ includeSelf: true }); const { canceled: canceled2, result: period } = await os.select({ title: i18n.ts.period, diff --git a/packages/frontend/src/pages/admin/users.vue b/packages/frontend/src/pages/admin/users.vue index ea4c231af2..6a38ebec64 100644 --- a/packages/frontend/src/pages/admin/users.vue +++ b/packages/frontend/src/pages/admin/users.vue @@ -90,7 +90,7 @@ const pagination = { }; function searchUser() { - os.selectUser().then(user => { + os.selectUser({ includeSelf: true }).then(user => { show(user); }); } diff --git a/packages/frontend/src/pages/my-antennas/editor.vue b/packages/frontend/src/pages/my-antennas/editor.vue index a4c6ca6f52..17d1167acc 100644 --- a/packages/frontend/src/pages/my-antennas/editor.vue +++ b/packages/frontend/src/pages/my-antennas/editor.vue @@ -129,7 +129,7 @@ async function deleteAntenna() { } function addUser() { - os.selectUser().then(user => { + os.selectUser({ includeSelf: true }).then(user => { users.value = users.value.trim(); users.value += '\n@' + Misskey.acct.toString(user as any); users.value = users.value.trim(); diff --git a/packages/frontend/src/pages/search.note.vue b/packages/frontend/src/pages/search.note.vue index 1bc4503dd9..ff9b63e222 100644 --- a/packages/frontend/src/pages/search.note.vue +++ b/packages/frontend/src/pages/search.note.vue @@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only