mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-12 21:58:12 +09:00
Fix(frontend): リバーシで自分自信を招待できるのを修正 & os.selectUser()のincludeSelfが機能していないのを修正 (#13117)
* リバーシで自分自信を招待できるのを修正 & os.selectUser()のincludeSelfが機能していないのを修正 * lint fix
This commit is contained in:
parent
5079a4b7dd
commit
0641454c23
@ -101,7 +101,13 @@ function search() {
|
|||||||
limit: 10,
|
limit: 10,
|
||||||
detail: false,
|
detail: false,
|
||||||
}).then(_users => {
|
}).then(_users => {
|
||||||
users.value = _users;
|
users.value = _users.filter((u) => {
|
||||||
|
if (props.includeSelf === false) {
|
||||||
|
return u.id !== $i?.id;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,18 +137,22 @@ onMounted(() => {
|
|||||||
misskeyApi('users/show', {
|
misskeyApi('users/show', {
|
||||||
userIds: defaultStore.state.recentlyUsedUsers,
|
userIds: defaultStore.state.recentlyUsedUsers,
|
||||||
}).then(foundUsers => {
|
}).then(foundUsers => {
|
||||||
const _users = foundUsers.filter((u) => {
|
let _users = foundUsers;
|
||||||
|
_users = _users.filter((u) => {
|
||||||
if (props.localOnly) {
|
if (props.localOnly) {
|
||||||
return u.host == null;
|
return u.host == null;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (props.includeSelf && _users.find(x => $i ? x.id === $i.id : true) == null) {
|
_users = _users.filter((u) => {
|
||||||
recentUsers.value = [$i!, ..._users];
|
if (props.includeSelf === false) {
|
||||||
} else {
|
return u.id !== $i?.id;
|
||||||
recentUsers.value = _users;
|
} else {
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
recentUsers.value = _users;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -196,7 +196,7 @@ async function matchHeatbeat() {
|
|||||||
async function matchUser() {
|
async function matchUser() {
|
||||||
pleaseLogin();
|
pleaseLogin();
|
||||||
|
|
||||||
const user = await os.selectUser({ localOnly: true });
|
const user = await os.selectUser({ includeSelf: false, localOnly: true });
|
||||||
if (user == null) return;
|
if (user == null) return;
|
||||||
|
|
||||||
matchingUser.value = user;
|
matchingUser.value = user;
|
||||||
|
Loading…
Reference in New Issue
Block a user