Skip to content

Commit

Permalink
fix: rerender actor images when editing profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Ribiere committed Jan 5, 2025
1 parent 7485aec commit d8b4903
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions vue/src/views/actors/ActorSheetView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@
<ActorRelatedContent :actor="actor" v-if="appStore.mobile" />
<div class="SheetView__block SheetView__block--bottom">
<SectionBanner :text="$t('actorPage.images')" />
<ImagesMosaic :images="[...actor.images, ...actor.externalImages]" />
<ImagesMosaic :images="actorImages" :key="mosaicKey" />
<ContentDivider />
</div>
</div>
</template>
<script setup lang="ts">
import type { Actor } from '@/models/interfaces/Actor'
import { useActorsStore } from '@/stores/actorsStore'
import { computed, onMounted, watchEffect } from 'vue'
import { computed, onMounted, watchEffect, ref } from 'vue'
import { useRoute } from 'vue-router'
import SheetContentBanner from '@/views/_layout/sheet/SheetContentBanner.vue'
import ContentDivider from '@/components/content/ContentDivider.vue'
Expand All @@ -93,6 +93,20 @@ const userStore = useUserStore()
const actorsStore = useActorsStore()
const actor = computed(() => actorsStore.selectedActor)
const actorImages = computed(() => {
const images = actor.value?.images ?? []
const externalImages = actor.value?.externalImages ?? []
return [...images, ...externalImages]
})
const mosaicKey = ref(0)
watchEffect(() => {
if (actorImages.value) {
mosaicKey.value++
}
})
onMounted(() => {
const route = useRoute()
watchEffect(() => {
Expand Down

0 comments on commit d8b4903

Please sign in to comment.