fix(ContactDetailsAvatar): tabbing - #5593
Open
GVodyanov wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
hamza221
reviewed
Aug 6, 2026
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
GVodyanov
force-pushed
the
fix/tabbing-contact-details
branch
from
August 9, 2026 08:54
dc7d632 to
6ec1b66
Compare
odzhychko
approved these changes
Aug 9, 2026
odzhychko
left a comment
There was a problem hiding this comment.
Code works and fixes the linked issue.
| const ccc = `data:${type};base64,${data.toString('base64')}` | ||
| this.$refs.cropper.replace(ccc) | ||
| this.showCropper = true | ||
| await this.$nextTick() |
There was a problem hiding this comment.
suggestion(non-blocking): Replace showCropper with cropperSrc. Avoids $nextTick and simplifies code overall.
diff --git a/src/components/ContactDetails/ContactDetailsAvatar.vue b/src/components/ContactDetails/ContactDetailsAvatar.vue
index 68ac0e89f..cddfa8424 100644
--- a/src/components/ContactDetails/ContactDetailsAvatar.vue
+++ b/src/components/ContactDetails/ContactDetailsAvatar.vue
@@ -30,10 +30,11 @@
:url="photoUrl"
class="contact-header-avatar__photo" />
- <NcModal v-if="showCropper" size="small" @close="cancel">
+ <NcModal v-if="cropperSrc" size="small" @close="cancel">
<div class="avatar__container">
<h2>{{ t('contacts', 'Crop contact photo') }}</h2>
<VueCropper
+ :src="cropperSrc"
ref="cropper"
class="avatar__cropper"
v-bind="cropperOptions" />
@@ -179,7 +180,7 @@ export default {
loading: false,
photoUrl: undefined,
root: generateRemoteUrl(`dav/files/${getCurrentUser().uid}`),
- showCropper: false,
+ cropperSrc: undefined,
cropperOptions: {
aspectRatio: 1 / 1,
viewMode: 3,
@@ -252,7 +253,7 @@ export default {
}
}
- await this.openCropper(data, type)
+ this.openCropper(data, type)
return true
},
@@ -262,11 +263,8 @@ export default {
* @param {Buffer} data the image
* @param {string} type of the image
*/
- async openCropper(data, type) {
- const ccc = `data:${type};base64,${data.toString('base64')}`
- this.showCropper = true
- await this.$nextTick()
- this.$refs.cropper.replace(ccc)
+ openCropper(data, type) {
+ this.cropperSrc = `data:${type};base64,${data.toString('base64')}`
},
/**
@@ -417,7 +415,7 @@ export default {
* Save the cropped image
*/
saveAvatar() {
- this.showCropper = false
+ this.cropperSrc = undefined
this.loading = true
this.$refs.cropper.getCroppedCanvas({
@@ -455,7 +453,7 @@ export default {
* Cancel cropping
*/
cancel() {
- this.showCropper = false
+ this.cropperSrc = undefined
this.loading = false
},
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #5579
🤖 AI (if applicable)