From b9ee14fe5b185f3533326a15f05056cc8bd685ce Mon Sep 17 00:00:00 2001
From: tamaina <tamaina@hotmail.co.jp>
Date: Wed, 22 Feb 2023 14:47:51 +0900
Subject: fix:
 MkUserSelectDialog/search-by-username-and-hostでローカルユーザーを絞って検索できない問題を修正
 (#9943)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* fix: MkUserSelectDialog/search-by-username-and-hostでローカルユーザーを絞って検索できない問題を修正
Fix #9627

* update CHANGELOG.md

* clean up

* search-by-username-and-host大改造
---
 packages/frontend/src/components/MkUserSelectDialog.vue | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'packages/frontend/src/components/MkUserSelectDialog.vue')

diff --git a/packages/frontend/src/components/MkUserSelectDialog.vue b/packages/frontend/src/components/MkUserSelectDialog.vue
index 981ae56e6c..4ce8c08512 100644
--- a/packages/frontend/src/components/MkUserSelectDialog.vue
+++ b/packages/frontend/src/components/MkUserSelectDialog.vue
@@ -16,7 +16,7 @@
 					<template #label>{{ i18n.ts.username }}</template>
 					<template #prefix>@</template>
 				</MkInput>
-				<MkInput v-model="host" @update:model-value="search">
+				<MkInput v-model="host" @update:model-value="search" :datalist="[hostname]">
 					<template #label>{{ i18n.ts.host }}</template>
 					<template #prefix>@</template>
 				</MkInput>
@@ -61,6 +61,7 @@ import * as os from '@/os';
 import { defaultStore } from '@/store';
 import { i18n } from '@/i18n';
 import { $i } from '@/account';
+import { hostname } from '@/config';
 
 const emit = defineEmits<{
 	(ev: 'ok', selected: misskey.entities.UserDetailed): void;
@@ -115,7 +116,7 @@ onMounted(() => {
 	os.api('users/show', {
 		userIds: defaultStore.state.recentlyUsedUsers,
 	}).then(users => {
-		if (props.includeSelf) {
+		if (props.includeSelf && users.find(x => $i ? x.id === $i.id : true) == null) {
 			recentUsers = [$i, ...users];
 		} else {
 			recentUsers = users;
-- 
cgit v1.2.3-freya

