diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2024-07-30 13:11:06 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-30 13:11:06 +0900 |
| commit | 738b3ea43b059b103deca0b1a33071ae256ef79f (patch) | |
| tree | b47248996be4aa737cedcb62bdc04aa7aa63fcd2 /packages/frontend/src/os.ts | |
| parent | enhance: 管理画面でアーカイブにしたお知らせを表示・編... (diff) | |
| download | misskey-738b3ea43b059b103deca0b1a33071ae256ef79f.tar.gz misskey-738b3ea43b059b103deca0b1a33071ae256ef79f.tar.bz2 misskey-738b3ea43b059b103deca0b1a33071ae256ef79f.zip | |
enhance(frontend): デッキのアンテナ・リスト選択画面からそれぞれを新規作成できるように (#14104)
* enhance(frontend): デッキのアンテナ・リスト選択画面からそれぞれを新規作成できるように
* Update Changelog
* fix
* fix
* lint
* add story
* typo
ねぼけていた
* Update antenna-column.vue
---------
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/frontend/src/os.ts')
| -rw-r--r-- | packages/frontend/src/os.ts | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 3085f33e21..a8dd99c854 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -447,15 +447,20 @@ export function authenticateDialog(): Promise<{ }); } +type SelectItem<C> = { + value: C; + text: string; +}; + // default が指定されていたら result は null になり得ないことを保証する overload function export function select<C = any>(props: { title?: string; text?: string; default: string; - items: { - value: C; - text: string; - }[]; + items: (SelectItem<C> | { + sectionTitle: string; + items: SelectItem<C>[]; + } | undefined)[]; }): Promise<{ canceled: true; result: undefined; } | { @@ -465,10 +470,10 @@ export function select<C = any>(props: { title?: string; text?: string; default?: string | null; - items: { - value: C; - text: string; - }[]; + items: (SelectItem<C> | { + sectionTitle: string; + items: SelectItem<C>[]; + } | undefined)[]; }): Promise<{ canceled: true; result: undefined; } | { @@ -478,10 +483,10 @@ export function select<C = any>(props: { title?: string; text?: string; default?: string | null; - items: { - value: C; - text: string; - }[]; + items: (SelectItem<C> | { + sectionTitle: string; + items: SelectItem<C>[]; + } | undefined)[]; }): Promise<{ canceled: true; result: undefined; } | { @@ -492,7 +497,7 @@ export function select<C = any>(props: { title: props.title, text: props.text, select: { - items: props.items, + items: props.items.filter(x => x !== undefined), default: props.default ?? null, }, }, { |