diff --git a/apps/stage-tamagotchi/src/renderer/components/WithScreenCapture.vue b/apps/stage-tamagotchi/src/renderer/components/WithScreenCapture.vue index a053ec131..e96d2373a 100644 --- a/apps/stage-tamagotchi/src/renderer/components/WithScreenCapture.vue +++ b/apps/stage-tamagotchi/src/renderer/components/WithScreenCapture.vue @@ -12,6 +12,10 @@ const props = defineProps<{ sourcesOptions: SourcesOptions }>() +const emit = defineEmits<{ + permissionGranted: [] +}>() + const sourcesOptions = toRef(props, 'sourcesOptions') const hasPermissions = ref(false) @@ -57,6 +61,12 @@ watch(focused, async (isFocused) => { await checkPermissions() } }) + +watch(hasPermissions, (nextHasPermissions, previousHasPermissions) => { + if (nextHasPermissions && !previousHasPermissions) { + emit('permissionGranted') + } +})