Skip to content

Commit a0b2a73

Browse files
committed
UI/Avatar: Lösche Bild in zwei Phasen
fixes #358
1 parent e023d17 commit a0b2a73

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

svws-webclient/ui/src/ui/SvwsUiAvatar.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<span class="icon i-ri-camera-line w-full h-full opacity-50 inline-block" />
66
</span>
77
<svws-ui-button v-if="src && (src.split(',').length > 1)" type="icon" @click="deleteImage" tabindex="0" title="Bild löschen">
8-
<span class="icon i-ri-delete-bin-line inline-block" />
8+
<span class="icon i-ri-delete-bin-line inline-block" :class="{'icon-ui-caution': stage}" />
99
</svws-ui-button>
1010
<svws-ui-button v-if="upload && (uploadedImage === null) && (src.split(',').length < 2)" type="icon" @click="toggleUpload" tabindex="0" title="Bild hochladen">
1111
<input class="hidden" ref="fileInputEl" type="file" accept="image/*" @change="onFileChanged">
@@ -76,6 +76,8 @@
7676
7777
const hasVideoDevice = ref(false);
7878
79+
const stage = ref<boolean>(false);
80+
7981
onMounted(async () => {
8082
// test if media device available
8183
const list = await navigator.mediaDevices.enumerateDevices();
@@ -89,6 +91,9 @@
8991
const file = ref<File | null>(null);
9092
9193
function deleteImage() {
94+
stage.value = !stage.value;
95+
if (stage.value)
96+
return;
9297
emit('image:base64', null);
9398
emit('image:captured', null);
9499
}

0 commit comments

Comments
 (0)