fix(ui): fix channel page infinite loop after upload

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2307>
pipelines/27771
wvffle 2022-12-27 22:33:05 +00:00 zatwierdzone przez Marge
rodzic d3fda52e4f
commit 61af75d712
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -91,9 +91,12 @@ const fetchData = async () => {
}
watch(() => props.id, fetchData, { immediate: true })
watchEffect(() => {
const publication = store.state.channels.latestPublication
if (publication?.uploads && publication.channel.uuid === object.value?.uuid) {
const uuid = computed(() => store.state.channels.latestPublication?.channel.uuid)
watch([uuid, object], ([uuid, object], [lastUuid, lastObject]) => {
if (object?.uuid && object.uuid === lastObject?.uuid) return
if (uuid && uuid === object?.uuid) {
fetchData()
}
})