fix: カラムの名前が正しくリスト/チャンネルの名前にならない問題 (#15987)
* fix: カラムの名前が正しくリスト/チャンネルの名前にならない問題 * changelog Fix: カラムの名前が正しくリスト/チャンネルの名前にならない問題を修正 * reduce requests to retrieve timeline name
This commit is contained in:
parent
9539995458
commit
8bd84a0ec4
|
|
@ -37,6 +37,7 @@
|
||||||
- Fix: 一部の設定検索結果が存在しないパスになる問題を修正
|
- Fix: 一部の設定検索結果が存在しないパスになる問題を修正
|
||||||
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1171)
|
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1171)
|
||||||
- Fix: テーマエディタが動作しない問題を修正
|
- Fix: テーマエディタが動作しない問題を修正
|
||||||
|
- Fix: カラムの名前が正しくリスト/チャンネルの名前にならない問題を修正
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
- Enhance: ノートの削除処理の効率化
|
- Enhance: ノートの削除処理の効率化
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,8 @@ export type Column = {
|
||||||
withSensitive?: boolean;
|
withSensitive?: boolean;
|
||||||
onlyFiles?: boolean;
|
onlyFiles?: boolean;
|
||||||
soundSetting?: SoundStore;
|
soundSetting?: SoundStore;
|
||||||
|
// The cache for the name of the antenna, channel, list, or role
|
||||||
|
timelineNameCache?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const _currentProfile = prefer.s['deck.profiles'].find(p => p.name === prefer.s['deck.profile']);
|
const _currentProfile = prefer.s['deck.profiles'].find(p => p.name === prefer.s['deck.profile']);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<template>
|
<template>
|
||||||
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
||||||
<template #header>
|
<template #header>
|
||||||
<i class="ti ti-antenna"></i><span style="margin-left: 8px;">{{ column.name || antennaName || i18n.ts._deck._columns.antenna }}</span>
|
<i class="ti ti-antenna"></i><span style="margin-left: 8px;">{{ column.name || column.timelineNameCache || i18n.ts._deck._columns.antenna }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<MkStreamingNotesTimeline v-if="column.antennaId" ref="timeline" src="antenna" :antenna="column.antennaId"/>
|
<MkStreamingNotesTimeline v-if="column.antennaId" ref="timeline" src="antenna" :antenna="column.antennaId"/>
|
||||||
|
|
@ -35,18 +35,13 @@ const props = defineProps<{
|
||||||
|
|
||||||
const timeline = useTemplateRef('timeline');
|
const timeline = useTemplateRef('timeline');
|
||||||
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
||||||
const antennaName = ref<string | null>(null);
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.column.antennaId == null) {
|
if (props.column.antennaId == null) {
|
||||||
setAntenna();
|
setAntenna();
|
||||||
}
|
} else if (props.column.timelineNameCache == null) {
|
||||||
});
|
|
||||||
|
|
||||||
watch([() => props.column.name, () => props.column.antennaId], () => {
|
|
||||||
if (!props.column.name && props.column.antennaId) {
|
|
||||||
misskeyApi('antennas/show', { antennaId: props.column.antennaId })
|
misskeyApi('antennas/show', { antennaId: props.column.antennaId })
|
||||||
.then(value => antennaName.value = value.name);
|
.then(value => updateColumn(props.column.id, { timelineNameCache: value.name }));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -77,6 +72,7 @@ async function setAntenna() {
|
||||||
antennasCache.delete();
|
antennasCache.delete();
|
||||||
updateColumn(props.column.id, {
|
updateColumn(props.column.id, {
|
||||||
antennaId: newAntenna.id,
|
antennaId: newAntenna.id,
|
||||||
|
timelineNameCache: newAntenna.name,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
closed: () => {
|
closed: () => {
|
||||||
|
|
@ -88,6 +84,7 @@ async function setAntenna() {
|
||||||
|
|
||||||
updateColumn(props.column.id, {
|
updateColumn(props.column.id, {
|
||||||
antennaId: antenna.id,
|
antennaId: antenna.id,
|
||||||
|
timelineNameCache: antenna.name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<template>
|
<template>
|
||||||
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
||||||
<template #header>
|
<template #header>
|
||||||
<i class="ti ti-device-tv"></i><span style="margin-left: 8px;">{{ column.name || channel?.name || i18n.ts._deck._columns.channel }}</span>
|
<i class="ti ti-device-tv"></i><span style="margin-left: 8px;">{{ column.name || column.timelineNameCache || i18n.ts._deck._columns.channel }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.channelId">
|
<template v-if="column.channelId">
|
||||||
|
|
@ -46,13 +46,9 @@ const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null,
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.column.channelId == null) {
|
if (props.column.channelId == null) {
|
||||||
setChannel();
|
setChannel();
|
||||||
}
|
} else if (!props.column.name && props.column.channelId) {
|
||||||
});
|
|
||||||
|
|
||||||
watch([() => props.column.name, () => props.column.channelId], () => {
|
|
||||||
if (!props.column.name && props.column.channelId) {
|
|
||||||
misskeyApi('channels/show', { channelId: props.column.channelId })
|
misskeyApi('channels/show', { channelId: props.column.channelId })
|
||||||
.then(value => channel.value = value);
|
.then(value => updateColumn(props.column.id, { timelineNameCache: value.name }));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -72,7 +68,7 @@ async function setChannel() {
|
||||||
if (canceled || chosenChannel == null) return;
|
if (canceled || chosenChannel == null) return;
|
||||||
updateColumn(props.column.id, {
|
updateColumn(props.column.id, {
|
||||||
channelId: chosenChannel.id,
|
channelId: chosenChannel.id,
|
||||||
name: chosenChannel.name,
|
timelineNameCache: chosenChannel.name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<template>
|
<template>
|
||||||
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
||||||
<template #header>
|
<template #header>
|
||||||
<i class="ti ti-list"></i><span style="margin-left: 8px;">{{ (column.name || listName) ?? i18n.ts._deck._columns.list }}</span>
|
<i class="ti ti-list"></i><span style="margin-left: 8px;">{{ column.name || column.timelineNameCache || i18n.ts._deck._columns.list }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<MkStreamingNotesTimeline v-if="column.listId" ref="timeline" src="list" :list="column.listId" :withRenotes="withRenotes"/>
|
<MkStreamingNotesTimeline v-if="column.listId" ref="timeline" src="list" :list="column.listId" :withRenotes="withRenotes"/>
|
||||||
|
|
@ -36,18 +36,13 @@ const props = defineProps<{
|
||||||
const timeline = useTemplateRef('timeline');
|
const timeline = useTemplateRef('timeline');
|
||||||
const withRenotes = ref(props.column.withRenotes ?? true);
|
const withRenotes = ref(props.column.withRenotes ?? true);
|
||||||
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
||||||
const listName = ref<string | null>(null);
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.column.listId == null) {
|
if (props.column.listId == null) {
|
||||||
setList();
|
setList();
|
||||||
}
|
} else if (props.column.timelineNameCache == null) {
|
||||||
});
|
|
||||||
|
|
||||||
watch([() => props.column.name, () => props.column.listId], () => {
|
|
||||||
if (!props.column.name && props.column.listId) {
|
|
||||||
misskeyApi('users/lists/show', { listId: props.column.listId })
|
misskeyApi('users/lists/show', { listId: props.column.listId })
|
||||||
.then(value => listName.value = value.name);
|
.then(value => updateColumn(props.column.id, { timelineNameCache: value.name }));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -89,10 +84,12 @@ async function setList() {
|
||||||
|
|
||||||
updateColumn(props.column.id, {
|
updateColumn(props.column.id, {
|
||||||
listId: res.id,
|
listId: res.id,
|
||||||
|
timelineNameCache: res.name,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
updateColumn(props.column.id, {
|
updateColumn(props.column.id, {
|
||||||
listId: list.id,
|
listId: list.id,
|
||||||
|
timelineNameCache: list.name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<template>
|
<template>
|
||||||
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
||||||
<template #header>
|
<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>
|
</template>
|
||||||
|
|
||||||
<MkStreamingNotesTimeline v-if="column.roleId" ref="timeline" src="role" :role="column.roleId"/>
|
<MkStreamingNotesTimeline v-if="column.roleId" ref="timeline" src="role" :role="column.roleId"/>
|
||||||
|
|
@ -33,18 +33,13 @@ const props = defineProps<{
|
||||||
|
|
||||||
const timeline = useTemplateRef('timeline');
|
const timeline = useTemplateRef('timeline');
|
||||||
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
||||||
const roleName = ref<string | null>(null);
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.column.roleId == null) {
|
if (props.column.roleId == null) {
|
||||||
setRole();
|
setRole();
|
||||||
}
|
} else if (props.column.timelineNameCache == null) {
|
||||||
});
|
|
||||||
|
|
||||||
watch([() => props.column.name, () => props.column.roleId], () => {
|
|
||||||
if (!props.column.name && props.column.roleId) {
|
|
||||||
misskeyApi('roles/show', { roleId: props.column.roleId })
|
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;
|
if (canceled || role == null) return;
|
||||||
updateColumn(props.column.id, {
|
updateColumn(props.column.id, {
|
||||||
roleId: role.id,
|
roleId: role.id,
|
||||||
|
timelineNameCache: role.name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue