enhance(frontend): アンテナ、リスト等の名前をdeckのカラム名のデフォルト値にするように (#13992)
* refactor: remove type errors from deck.vue and deck-store.ts * feat: アンテナ、リスト等の名前をカラム名のデフォルト値にするように * docs: アンテナ、リスト等の名前をカラム名のデフォルト値にするように * lint: fix * chore: カラム名が指定されている場合にはチャンネル名を取得しないように * chore: チャンネルについては投稿でも使用されてる channel 変数を使用するように * docs: fix changelog --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
This commit is contained in:
@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template>
|
||||
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
||||
<template #header>
|
||||
<i class="ti ti-badge"></i><span style="margin-left: 8px;">{{ column.name }}</span>
|
||||
<i class="ti ti-badge"></i><span style="margin-left: 8px;">{{ column.name || roleName || i18n.ts._deck._columns.roleTimeline }}</span>
|
||||
</template>
|
||||
|
||||
<MkTimeline v-if="column.roleId" ref="timeline" src="role" :role="column.roleId" @note="onNote"/>
|
||||
@@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, shallowRef, watch } from 'vue';
|
||||
import { computed, onMounted, ref, shallowRef, watch } from 'vue';
|
||||
import XColumn from './column.vue';
|
||||
import { updateColumn } from './deck-store.js';
|
||||
import type { Column } from './deck-store.js';
|
||||
@@ -34,6 +34,7 @@ const props = defineProps<{
|
||||
|
||||
const timeline = shallowRef<InstanceType<typeof MkTimeline>>();
|
||||
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
||||
const roleName = ref<string | null>(null);
|
||||
|
||||
onMounted(() => {
|
||||
if (props.column.roleId == null) {
|
||||
@@ -41,6 +42,13 @@ onMounted(() => {
|
||||
}
|
||||
});
|
||||
|
||||
watch([() => props.column.name, () => props.column.roleId], () => {
|
||||
if (!props.column.name && props.column.roleId) {
|
||||
misskeyApi('roles/show', { roleId: props.column.roleId })
|
||||
.then(value => roleName.value = value.name);
|
||||
}
|
||||
});
|
||||
|
||||
watch(soundSetting, v => {
|
||||
updateColumn(props.column.id, { soundSetting: v });
|
||||
});
|
||||
|
Reference in New Issue
Block a user