Skip to content

Commit

Permalink
fix(entities-shared): add missing watcher to permissions-wrapper (#745)
Browse files Browse the repository at this point in the history
* fix(entities-shared): add missing watcher to permissions-wrapper

* Update PermissionsWrapper.vue

Co-authored-by: Yi Yang <Leopoldthecoder@users.noreply.github.com>

* Update packages/entities/entities-shared/src/components/permissions-wrapper/PermissionsWrapper.vue

---------

Co-authored-by: Yi Yang <Leopoldthecoder@users.noreply.github.com>
  • Loading branch information
sumimakito and Leopoldthecoder committed Aug 30, 2023
1 parent 24454d9 commit f4a54e0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<script setup lang="ts">
import type { PropType } from 'vue'
import { ref, computed, onBeforeMount } from 'vue'
import { ref, computed, watch } from 'vue'
const props = defineProps({
/**
Expand All @@ -34,7 +34,7 @@ const props = defineProps({
const isAllowed = ref<boolean | undefined>(undefined)
const showSlotContent = computed((): boolean => isAllowed.value === true || (isAllowed.value !== undefined && props.forceShow === true))
onBeforeMount(async (): Promise<void> => {
watch(() => props.authFunction, async () => {
isAllowed.value = await props.authFunction()
})
}, { immediate: true })
</script>

0 comments on commit f4a54e0

Please sign in to comment.