Skip to content

Commit 084efae

Browse files
committed
(refacto) add computed imageBackground
1 parent 80a10ec commit 084efae

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ChatWindow/Message/MessageImage.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
isImageLoading && message.senderId === currentUserId
1212
}"
1313
:style="{
14-
'background-image': `url('${isImageLoading ? message.file.preview || message.file.url : message.file.url}')`,
14+
'background-image': `url('${imageBackground}')`,
1515
'max-height': `${imageResponsive.maxHeight}px`
1616
}"
1717
>
@@ -82,6 +82,11 @@ export default {
8282
return (
8383
this.message.file.url.indexOf('blob:http') !== -1 || this.imageLoading
8484
)
85+
},
86+
imageBackground() {
87+
return this.isImageLoading
88+
? this.message.file.preview || this.message.file.url
89+
: this.message.file.url
8590
}
8691
},
8792

0 commit comments

Comments
 (0)