forked from mirrors/misskey
refactor(frontend): os.select, MkSelectのitem指定をオブジェクトによる定義に統一し、型を狭める (#16475)
* refactor(frontend): MkSelectのitem指定をオブジェクトによる定義に統一 * fix * spdx * fix * fix os.select * fix lint * add comment * fix * fix: os.select対応漏れを修正 * fix * fix * fix: MkSelectのmodelに対する型チェックを厳格化 * fix * fix * fix * Update packages/frontend/src/components/MkEmbedCodeGenDialog.vue Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> * fix * fix types * fix * fix * Update packages/frontend/src/pages/admin/roles.editor.vue Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> * fix: MkSelectに直接配列を指定している場合に正常に型が解決されるように --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
@@ -49,14 +49,15 @@ watch(soundSetting, v => {
|
||||
|
||||
async function setRole() {
|
||||
const roles = (await misskeyApi('roles/list')).filter(x => x.isExplorable);
|
||||
const { canceled, result: role } = await os.select({
|
||||
const { canceled, result: roleId } = await os.select({
|
||||
title: i18n.ts.role,
|
||||
items: roles.map(x => ({
|
||||
value: x, text: x.name,
|
||||
value: x.id, label: x.name,
|
||||
})),
|
||||
default: props.column.roleId,
|
||||
});
|
||||
if (canceled || role == null) return;
|
||||
if (canceled || roleId == null) return;
|
||||
const role = roles.find(x => x.id === roleId)!;
|
||||
updateColumn(props.column.id, {
|
||||
roleId: role.id,
|
||||
timelineNameCache: role.name,
|
||||
|
||||
Reference in New Issue
Block a user