Skip to content

Commit

Permalink
fix: update blocks after change slide
Browse files Browse the repository at this point in the history
  • Loading branch information
devlzl committed Jan 15, 2024
1 parent 12c0642 commit c7807d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/UserInterface/Slide/Slide.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted, shallowRef, triggerRef } from 'vue'
import { ref, onMounted, shallowRef } from 'vue'
import { slideManager } from '@Kernel/index'
import { BlockViews } from '@BlockHub/BlockHub'
import { toolBox, selectionManager } from '@Kernel/index'
Expand All @@ -17,11 +17,12 @@ const slide = shallowRef(slideManager.currentSlide)
const blocks = shallowRef(slide.value.blocks)
const updateBlocks = () => {
blocks.value = slide.value.blocks
triggerRef(blocks)
}
slideManager.events.update.on(() => {
slide.value = slideManager.currentSlide
slide.value.events.blockChange.on(updateBlocks)
selectionManager.clear()
updateBlocks()
})
slide.value.events.blockChange.on(() => {
updateBlocks()
Expand Down

0 comments on commit c7807d2

Please sign in to comment.