restore store-based convo display, but still use fullyLoaded

This commit is contained in:
Henry Jameson 2026-09-16 13:57:48 +03:00
commit 8eed3f14f9

View file

@ -51,7 +51,6 @@ export function useConversation(statusId, expanded) {
return idA < idB ? -1 : 1 return idA < idB ? -1 : 1
} }
} }
const fullConversation = ref(new Set([mainStatus.value?.id].filter(Boolean)))
const fullyLoaded = ref(false) const fullyLoaded = ref(false)
const conversationId = computed( const conversationId = computed(
() => mainStatus.value?.statusnet_conversation_id, () => mainStatus.value?.statusnet_conversation_id,
@ -64,11 +63,15 @@ export function useConversation(statusId, expanded) {
return [] return []
} }
if (!expanded.value) { if (!expanded.value || !fullyLoaded.value) {
return [currentStatus.value] return [currentStatus.value]
} }
return [...fullConversation.value.keys()] const fullConversation = useStatusesStore().conversations.get(
conversationId.value,
)
return [...fullConversation.keys()]
.map((k) => useStatusesStore().allStatuses.get(k)) .map((k) => useStatusesStore().allStatuses.get(k))
.filter((status) => status.type != 'repeat') // Old backend behavior? .filter((status) => status.type != 'repeat') // Old backend behavior?
.toSorted(sortById) .toSorted(sortById)
@ -111,12 +114,6 @@ export function useConversation(statusId, expanded) {
timestamp, timestamp,
}) })
fullConversation.value = new Set([
...ancestors,
mainStatus.value,
...descendants
].map(({ id }) => id))
await nextTick() await nextTick()
fullyLoaded.value = true fullyLoaded.value = true
} else { } else {
@ -129,9 +126,7 @@ export function useConversation(statusId, expanded) {
}) })
useStatusesStore().addNewStatuses({ statuses: [status] }) useStatusesStore().addNewStatuses({ statuses: [status] })
fullConversation.value = new Set([
currentStatus.value,
].map(({ id }) => id))
fetchConversation() fetchConversation()
} catch (error) { } catch (error) {
console.error(error) console.error(error)