1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-24 07:06:26 +09:00

enhance(client): Ask before puling user from group

This commit is contained in:
ltlapy 2022-07-16 02:14:14 +09:00
parent e850b8df9b
commit bfde265503
2 changed files with 14 additions and 5 deletions

View File

@ -824,6 +824,9 @@ voteConfirm: "「{choice}」に投票しますか?"
hide: "隠す"
leaveGroup: "グループから抜ける"
leaveGroupConfirm: "「{name}」から抜けますか?"
leader: "リーダー"
banish: "追放する"
banishConfirm: "{name}を追放しますか?"
useDrawerReactionPickerForMobile: "モバイルデバイスのときドロワーで表示"
welcomeBackWithName: "おかえりなさい、{name}さん"
clickToFinishEmailVerification: "[{ok}]を押して、メールアドレスの確認を完了してください。"

View File

@ -24,10 +24,10 @@
<MkUserName :user="user" class="name"/>
<MkAcct :user="user" class="acct"/>
</div>
<div v-if="group && $i.id === group.ownerId && user.id !== group.ownerId" class="action">
<button class="_button" @click="removeUser(user)"><i class="fas fa-times"></i></button>
<div v-if="user.id === group.ownerId" :title="$ts.leader" style="color: var(--badge);"><i class="fas fa-crown"></i></div>
<div v-else-if="group && $i.id === group.ownerId" class="action">
<button class="_button" :title="$ts.banish" @click="removeUser(user)"><i class="fas fa-times"></i></button>
</div>
<div v-else :title="$ts.administrator" style="color: var(--badge);"><i class="fas fa-crown"></i></div>
</div>
</div>
</div>
@ -74,8 +74,14 @@ function invite() {
});
}
function removeUser(user) {
os.api('users/groups/pull', {
async function removeUser(user) {
const { canceled } = await os.confirm({
type: 'warning',
text: i18n.t('banishConfirm', { name: user.name || user.username }),
});
if (canceled) return;
os.apiWithDialog('users/groups/pull', {
groupId: group.id,
userId: user.id,
}).then(() => {