Skip to content

Commit

Permalink
fix(frontend): selectUserのパラメータを調整 (misskey-dev#13142)
Browse files Browse the repository at this point in the history
* fix(frontend): selectUserのパラメータを調整

* ついでに軽微なスタイルの修正
  • Loading branch information
kakkokari-gtyih authored and AyumuNekozuki committed Feb 16, 2024
1 parent ee4051c commit c4b3464
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkAutocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/components/MkMediaVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ onDeactivated(() => {

.hidden {
width: 100%;
height: 100%;
background: #000;
border: none;
outline: none;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkPostForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) + ' ');
});
}
Expand Down
19 changes: 11 additions & 8 deletions packages/frontend/src/components/MkUserSelectDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
Expand All @@ -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;
}
});
});
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/admin/proxy-account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 1 addition & 3 deletions packages/frontend/src/pages/admin/roles.role.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/admin/users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const pagination = {
};

function searchUser() {
os.selectUser().then(user => {
os.selectUser({ includeSelf: true }).then(user => {
show(user);
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/my-antennas/editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/pages/search.note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div class="_gaps_m">
<MkSwitch v-model="isLocalOnly">{{ i18n.ts.localOnly }}</MkSwitch>

<MkFolder>
<MkFolder :defaultOpen="true">
<template #label>{{ i18n.ts.specifyUser }}</template>
<template v-if="user" #suffix>@{{ user.username }}</template>

Expand Down Expand Up @@ -64,7 +64,7 @@ const user = ref<any>(null);
const isLocalOnly = ref(false);

function selectUser() {
os.selectUser().then(_user => {
os.selectUser({ includeSelf: true }).then(_user => {
user.value = _user;
});
}
Expand Down

0 comments on commit c4b3464

Please sign in to comment.