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

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

* update CHANGELOG.md

* clean up

* search-by-username-and-host大改造
This commit is contained in:
tamaina
2023-02-22 14:47:51 +09:00
committed by GitHub
parent 6e68a78d6a
commit b9ee14fe5b
4 changed files with 69 additions and 66 deletions

View File

@ -23,7 +23,7 @@
@input="onInput"
>
<datalist v-if="datalist" :id="id">
<option v-for="data in datalist" :value="data"/>
<option v-for="data in datalist" :key="data" :value="data"/>
</datalist>
<div ref="suffixEl" class="suffix"><slot name="suffix"></slot></div>
</div>

View File

@ -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;