Skip to content

Commit

Permalink
fix(prop): avoid mutating shortTermToken prop directly (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
bathienle authored Aug 29, 2024
1 parent 2a9ca56 commit a7278a4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/image/ImagePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

<script>
import {changeImageUrlFormat} from '@/utils/image-utils';
import {get} from '@/utils/store-helpers';
import {appendShortTermToken} from '@/utils/token-utils.js';

export default {
Expand All @@ -45,9 +46,9 @@ export default {
fullHeightCard: {type: Boolean, default: true},
showProject: {type: Boolean, default: false},
blindMode: {type: Boolean, default: false},
shortTermToken: {type: String, default: null}
},
computed: {
shortTermToken: get('currentUser/shortTermToken'),
idImage() {
return this.image.image || this.image.id; // if provided object is image consultation, image.image
},
Expand All @@ -67,9 +68,6 @@ export default {
return {backgroundImage: `url("${appendShortTermToken(this.previewUrl, this.shortTermToken)}")`};
}
},
created() {
this.shortTermToken = this.$store.getters['currentUser/currentShortTermToken'];
}
};
</script>

Expand Down

0 comments on commit a7278a4

Please sign in to comment.