Skip to content

Commit

Permalink
Fix proof upload error (vuetify upgrade)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Aug 22, 2024
1 parent d24f66e commit 6edfbd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/PriceInputRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:suffix="priceForm.currency"
:hint="getPricePerUnit(priceForm.price)"
persistent-hint
@update:model-value="newValue => priceForm.price = fixComma(newValue)"
@update:modelValue="newValue => priceForm.price = fixComma(newValue)"
>
<template v-if="!hideCurrencyChoice" #prepend-inner>
<!-- image from https://www.svgrepo.com/svg/32717/currency-exchange -->
Expand All @@ -28,7 +28,7 @@
:suffix="priceForm.currency"
:hint="getPricePerUnit(priceForm.price_without_discount)"
persistent-hint
@update:model-value="newValue => priceForm.price_without_discount = fixComma(newValue)"
@update:modelValue="newValue => priceForm.price_without_discount = fixComma(newValue)"
/>
</v-col>
</v-row>
Expand Down
10 changes: 5 additions & 5 deletions src/components/ProofInputRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
</v-btn>
<v-file-input
ref="proofCamera" v-model="proofFormImage" class="d-none overflow-hidden" capture="environment"
accept="image/*" :loading="loading" @change="newProof('camera')" @click:clear="clearProof"
accept="image/*" :loading="loading" @update:modelValue="newProof('camera')" @click:clear="clearProof"
/>
<v-file-input
ref="proofGallery" v-model="proofFormImage" class="d-none overflow-hidden" accept="image/*, .heic"
:loading="loading" @change="newProof('gallery')" @click:clear="clearProof"
:loading="loading" @update:modelValue="newProof('gallery')" @click:clear="clearProof"
/>
<p v-if="!loading" class="mt-2 mb-2">
<i v-if="!proofFormImage" class="text-red">{{ $t('ProofCreate.SelectProof') }}</i>
Expand Down Expand Up @@ -195,10 +195,10 @@ export default {
})
},
newProof(source) {
this.proofFormImagePreview = this.getLocalProofUrl(this.proofFormImage[0])
this.proofFormImagePreview = this.getLocalProofUrl(this.proofFormImage)
if (source === 'gallery') {
// extract date from image exif
ExifReader.load(this.proofFormImage[0]).then((tags) => {
ExifReader.load(this.proofFormImage).then((tags) => {
if (tags['DateTimeOriginal'] && tags['DateTimeOriginal'].description) {
// exif DateTimeOriginal format: '2024:01:31 20:23:52'
const imageDateString = tags['DateTimeOriginal'].description.substring(0, 10).replaceAll(':', '-')
Expand All @@ -213,7 +213,7 @@ export default {
uploadProof() {
this.loading = true
new Promise((resolve, reject) => {
new Compressor(this.proofFormImage[0], {
new Compressor(this.proofFormImage, {
success: resolve,
error: reject
})
Expand Down

0 comments on commit 6edfbd1

Please sign in to comment.