From 7b7faf1e84c4f2c53a9adbfd918d91590c890a0a Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 13 Jan 2023 14:22:53 +0900 Subject: 招待コード発行を権限を持つユーザーが行えるように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolve #9541 --- packages/frontend/src/ui/_common_/common.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'packages/frontend/src/ui/_common_/common.ts') diff --git a/packages/frontend/src/ui/_common_/common.ts b/packages/frontend/src/ui/_common_/common.ts index c63e962a8d..079b31489e 100644 --- a/packages/frontend/src/ui/_common_/common.ts +++ b/packages/frontend/src/ui/_common_/common.ts @@ -2,6 +2,7 @@ import * as os from '@/os'; import { instance } from '@/instance'; import { host } from '@/config'; import { i18n } from '@/i18n'; +import { $i } from '@/account'; export function openInstanceMenu(ev: MouseEvent) { os.popupMenu([{ @@ -46,7 +47,23 @@ export function openInstanceMenu(ev: MouseEvent) { to: '/clicker', text: '🍪👈', icon: 'ti ti-cookie', - }], + }, ($i && ($i.isRoot || $i.role.canInvite) && instance.disableRegistration) ? { + text: i18n.ts.invite, + icon: 'ti ti-user-plus', + action: () => { + os.api('invite').then(x => { + os.alert({ + type: 'info', + text: x.code, + }); + }).catch(err => { + os.alert({ + type: 'error', + text: err, + }); + }); + }, + } : undefined], }, null, { text: i18n.ts.help, icon: 'ti ti-question-circle', -- cgit v1.2.3-freya