Skip to content

Commit

Permalink
fix(entities-plugins): custom plugins disappeared after page reload […
Browse files Browse the repository at this point in the history
…KM-658]
  • Loading branch information
2eha0 committed Oct 31, 2024
1 parent 93d89f5 commit f64c87a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<img
ref="img"
:alt="alt"
:height="size"
:src="iconSrc"
:width="size"
@error="onError"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</template>

<script setup lang="ts">
import { computed, nextTick, onMounted, ref, onUnmounted } from 'vue'
import { computed, nextTick, onMounted, ref, onBeforeUnmount, watch } from 'vue'
import type { PropType } from 'vue'
import {
PluginGroup,
Expand Down Expand Up @@ -217,13 +217,18 @@ const setToggleVisibility = (): void => {
onMounted(async () => {
await nextTick()
tallestPluginCardHeight.value = getTallestPluginCardHeight(pluginCardRef.value!)
setToggleVisibility()
window?.addEventListener('resize', handleResize)
})
onUnmounted(() => {
watch(modifiedCustomPlugins, () => {
handleResize()
}, {
immediate: true,
flush: 'post',
deep: false,
})
onBeforeUnmount(() => {
window?.removeEventListener('resize', handleResize)
})
</script>
Expand Down

0 comments on commit f64c87a

Please sign in to comment.