fix: stop stream on unmount and showCamera is false
This commit is contained in:
parent
d896d8e839
commit
04745fb5e7
@ -13,7 +13,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div
|
<div
|
||||||
class="flex flex-col items-center justify-center gap-4 rounded-lg border border-dashed min-h-64 text-ink-gray-5"
|
class="flex flex-col items-center justify-center gap-4 rounded-lg border border-dashed border-outline-gray-modals min-h-64 text-ink-gray-5"
|
||||||
@dragover.prevent="dragover"
|
@dragover.prevent="dragover"
|
||||||
@dragleave.prevent="dragleave"
|
@dragleave.prevent="dragleave"
|
||||||
@drop.prevent="dropfiles"
|
@drop.prevent="dropfiles"
|
||||||
@ -128,7 +128,7 @@ import FileAudioIcon from '@/components/Icons/FileAudioIcon.vue'
|
|||||||
import FileVideoIcon from '@/components/Icons/FileVideoIcon.vue'
|
import FileVideoIcon from '@/components/Icons/FileVideoIcon.vue'
|
||||||
import { createToast, formatDate, convertSize } from '@/utils'
|
import { createToast, formatDate, convertSize } from '@/utils'
|
||||||
import { FormControl, CircularProgressBar, createResource } from 'frappe-ui'
|
import { FormControl, CircularProgressBar, createResource } from 'frappe-ui'
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted, watch, onUnmounted } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
doctype: {
|
doctype: {
|
||||||
@ -383,6 +383,12 @@ function fileIcon(type) {
|
|||||||
return FileTextIcon
|
return FileTextIcon
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(showCamera, (value) => {
|
||||||
|
if (!value) stopStream()
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => stopStream())
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
showFileBrowser,
|
showFileBrowser,
|
||||||
showWebLink,
|
showWebLink,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user