fix: カラムの名前が正しくリスト/チャンネルの名前にならない問題 (#15987)

* fix: カラムの名前が正しくリスト/チャンネルの名前にならない問題

* changelog Fix: カラムの名前が正しくリスト/チャンネルの名前にならない問題を修正

* reduce requests to retrieve timeline name
This commit is contained in:
anatawa12
2025-08-09 10:43:07 +09:00
committed by GitHub
parent 9539995458
commit 8bd84a0ec4
6 changed files with 21 additions and 32 deletions

View File

@@ -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 || roleName || i18n.ts._deck._columns.roleTimeline }}</span>
<i class="ti ti-badge"></i><span style="margin-left: 8px;">{{ column.name || column.timelineNameCache || i18n.ts._deck._columns.roleTimeline }}</span>
</template>
<MkStreamingNotesTimeline v-if="column.roleId" ref="timeline" src="role" :role="column.roleId"/>
@@ -33,18 +33,13 @@ const props = defineProps<{
const timeline = useTemplateRef('timeline');
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
const roleName = ref<string | null>(null);
onMounted(() => {
if (props.column.roleId == null) {
setRole();
}
});
watch([() => props.column.name, () => props.column.roleId], () => {
if (!props.column.name && props.column.roleId) {
} else if (props.column.timelineNameCache == null) {
misskeyApi('roles/show', { roleId: props.column.roleId })
.then(value => roleName.value = value.name);
.then(value => updateColumn(props.column.id, { timelineNameCache: value.name }));
}
});
@@ -64,6 +59,7 @@ async function setRole() {
if (canceled || role == null) return;
updateColumn(props.column.id, {
roleId: role.id,
timelineNameCache: role.name,
});
}