From 61af75d712fbfd528fc67763f966ed82f7f443d0 Mon Sep 17 00:00:00 2001 From: wvffle Date: Tue, 27 Dec 2022 22:33:05 +0000 Subject: [PATCH] fix(ui): fix channel page infinite loop after upload Part-of: --- front/src/views/channels/DetailBase.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/front/src/views/channels/DetailBase.vue b/front/src/views/channels/DetailBase.vue index b052fe791..9020db02e 100644 --- a/front/src/views/channels/DetailBase.vue +++ b/front/src/views/channels/DetailBase.vue @@ -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() } })