aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2022-08-23 02:06:54 +0300
committerHenry Jameson <me@hjkos.com>2022-08-23 02:06:54 +0300
commit6e1639cc1e0f15760fdb26786c28fca4c3fd8c17 (patch)
tree9c5f33850bf883824ee15da013cec95bc51bbc24
parent420f29b6a460ead0a5b4d9ff61e3d3ca097bd798 (diff)
fetch text height only after mask has been loaded
-rw-r--r--src/components/update_notification/update_notification.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/components/update_notification/update_notification.js b/src/components/update_notification/update_notification.js
index 6cfe893c..c389750d 100644
--- a/src/components/update_notification/update_notification.js
+++ b/src/components/update_notification/update_notification.js
@@ -60,9 +60,14 @@ const UpdateNotification = {
}
},
mounted () {
- setTimeout(() => {
- this.contentHeight = this.$refs.animatedText.scrollHeight
- }, 1000)
+ // Workaround to get the text height only after mask loaded. A bit hacky.
+ const newImg = new Image()
+ newImg.onload = () => {
+ setTimeout(() => {
+ this.contentHeight = this.$refs.animatedText.scrollHeight
+ }, 100)
+ }
+ newImg.src = this.pleromaTanVariant === pleromaTan ? pleromaTanMask : pleromaTanFoxMask
}
}