Skip to content

Commit

Permalink
fix: remove errors on Proof card emits (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Mar 16, 2024
1 parent 44aab94 commit 3cdd81c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/components/ProofCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ export default {
proofEditDialog: false,
}
},
emits: ['proofUpdated'],
emits: ['proofSelected', 'proofUpdated', 'close'],
methods: {
selectProof() {
if (this.isSelectable) {
Expand Down
9 changes: 6 additions & 3 deletions src/components/UserRecentProofsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<v-card-title>
{{ $t('UserRecentProofsDialog.SelectRecentProof') }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="close"></v-btn>
</v-card-title>

<v-divider></v-divider>

<v-card-text>
<v-row>
<v-col cols="12" sm="6" md="3" v-for="proof in userProofList" :key="proof">
Expand All @@ -17,14 +19,14 @@
</template>

<script>
import { defineAsyncComponent } from 'vue'
import { mapStores } from 'pinia'
import { useAppStore } from '../store'
import api from '../services/api'
import ProofCard from '../components/ProofCard.vue'
export default {
components: {
ProofCard,
'ProofCard': defineAsyncComponent(() => import('../components/ProofCard.vue')),
},
data() {
return {
Expand All @@ -35,6 +37,7 @@ export default {
selectedProof: null,
}
},
emits: ['recentProofSelected', 'close'],
computed: {
...mapStores(useAppStore),
username() {
Expand All @@ -60,7 +63,7 @@ export default {
},
selectProof(proof) {
this.selectedProof = proof
this.$emit('proofConfirmed', this.selectedProof)
this.$emit('recentProofSelected', this.selectedProof)
this.close()
},
close() {
Expand Down
8 changes: 4 additions & 4 deletions src/views/AddPriceMultiple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
<UserRecentProofsDialog
v-if="userRecentProofsDialog"
v-model="userRecentProofsDialog"
@proofConfirmed="handleProofConfirmed"
@recentProofSelected="handleRecentProofSelected($event)"
@close="userRecentProofsDialog = false"
></UserRecentProofsDialog>
<ChangeCurrencyDialog
Expand All @@ -345,12 +345,12 @@
<script>
import Compressor from 'compressorjs'
import ExifReader from 'exifreader'
import { defineAsyncComponent } from 'vue'
import { mapStores } from 'pinia'
import { useAppStore } from '../store'
import api from '../services/api'
import utils from '../utils.js'
import LabelsTags from '../data/labels-tags.json'
import { defineAsyncComponent } from 'vue'
Compressor.setDefaults({
checkOrientation: true, // default
Expand Down Expand Up @@ -501,7 +501,7 @@ export default {
showUserRecentProofs() {
this.userRecentProofsDialog = true
},
handleProofConfirmed(selectedProof) {
handleRecentProofSelected(selectedProof) {
this.addPriceMultipleForm.proof_id = selectedProof.id
this.proofImagePreview = this.getProofUrl(selectedProof)
this.proofSelectedSuccessMessage = true
Expand Down Expand Up @@ -683,4 +683,4 @@ export default {
width: 24px;
height: 24px;
}
</style>
</style>
8 changes: 4 additions & 4 deletions src/views/AddPriceSingle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
<UserRecentProofsDialog
v-if="userRecentProofsDialog"
v-model="userRecentProofsDialog"
@proofConfirmed="handleProofConfirmed"
@recentProofSelected="handleRecentProofSelected($event)"
@close="userRecentProofsDialog = false"
></UserRecentProofsDialog>
<ChangeCurrencyDialog
Expand All @@ -296,12 +296,12 @@
<script>
import Compressor from 'compressorjs'
import ExifReader from 'exifreader'
import { defineAsyncComponent } from 'vue'
import { mapStores } from 'pinia'
import { useAppStore } from '../store'
import api from '../services/api'
import utils from '../utils.js'
import LabelsTags from '../data/labels-tags.json'
import { defineAsyncComponent } from 'vue'
Compressor.setDefaults({
checkOrientation: true, // default
Expand Down Expand Up @@ -448,7 +448,7 @@ export default {
showUserRecentProofs() {
this.userRecentProofsDialog = true
},
handleProofConfirmed(selectedProof) {
handleRecentProofSelected(selectedProof) {
this.addPriceSingleForm.proof_id = selectedProof.id
this.proofImagePreview = this.getProofUrl(selectedProof)
this.proofSelectedSuccessMessage = true
Expand Down Expand Up @@ -609,4 +609,4 @@ export default {
width: 24px;
height: 24px;
}
</style>
</style>

0 comments on commit 3cdd81c

Please sign in to comment.