From b68c35868857c0ff5ddf68cde5772d749504058c Mon Sep 17 00:00:00 2001 From: Marie Date: Thu, 25 Jan 2024 14:11:41 +0100 Subject: [PATCH] fix: reversi allowing you to search globally instead of just locally Misskey used a local option in the select section but os nor userselectdialog supported this. --- packages/frontend/src/components/MkUserSelectDialog.vue | 2 ++ packages/frontend/src/os.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/components/MkUserSelectDialog.vue b/packages/frontend/src/components/MkUserSelectDialog.vue index ad11ba1940..2c941fcfdd 100644 --- a/packages/frontend/src/components/MkUserSelectDialog.vue +++ b/packages/frontend/src/components/MkUserSelectDialog.vue @@ -76,6 +76,7 @@ const emit = defineEmits<{ const props = defineProps<{ includeSelf?: boolean; + local?: boolean; }>(); const username = ref(''); @@ -90,6 +91,7 @@ function search() { users.value = []; return; } + if (props.local) host.value = '.'; misskeyApi('users/search-by-username-and-host', { username: username.value, host: host.value, diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 9fc3603af0..2f41eaef29 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -419,7 +419,7 @@ export function form(title, form) { }); } -export async function selectUser(opts: { includeSelf?: boolean } = {}): Promise { +export async function selectUser(opts: { includeSelf?: boolean, local?: boolean } = {}): Promise { return new Promise((resolve, reject) => { popup(defineAsyncComponent(() => import('@/components/MkUserSelectDialog.vue')), { includeSelf: opts.includeSelf,