drop group (#9942)

* drop group

* Update operations.ts
This commit is contained in:
syuilo
2023-02-15 13:37:18 +09:00
committed by GitHub
parent 8f2049bcd2
commit 8caf288ac1
52 changed files with 66 additions and 1585 deletions

View File

@@ -35,28 +35,6 @@ export function getUserMenu(user, router: Router = mainRouter) {
});
}
async function inviteGroup() {
const groups = await os.api('users/groups/owned');
if (groups.length === 0) {
os.alert({
type: 'error',
text: i18n.ts.youHaveNoGroups,
});
return;
}
const { canceled, result: groupId } = await os.select({
title: i18n.ts.group,
items: groups.map(group => ({
value: group.id, text: group.name,
})),
});
if (canceled) return;
os.apiWithDialog('users/groups/invite', {
groupId: groupId,
userId: user.id,
});
}
async function toggleMute() {
if (user.isMuted) {
os.apiWithDialog('mute/delete', {
@@ -156,20 +134,11 @@ export function getUserMenu(user, router: Router = mainRouter) {
action: () => {
os.post({ specified: user });
},
}, meId !== user.id ? {
type: 'link',
icon: 'ti ti-messages',
text: i18n.ts.startMessaging,
to: '/my/messaging/' + Acct.toString(user),
} : undefined, null, {
}, null, {
icon: 'ti ti-list',
text: i18n.ts.addToList,
action: pushList,
}, meId !== user.id ? {
icon: 'ti ti-users',
text: i18n.ts.inviteToGroup,
action: inviteGroup,
} : undefined] as any;
}] as any;
if ($i && meId !== user.id) {
menu = menu.concat([null, {