fetch text height only after mask has been loaded

This commit is contained in:
Henry Jameson 2022-08-23 02:06:54 +03:00
parent 420f29b6a4
commit 6e1639cc1e
1 changed files with 8 additions and 3 deletions

View File

@ -60,9 +60,14 @@ const UpdateNotification = {
} }
}, },
mounted () { mounted () {
setTimeout(() => { // Workaround to get the text height only after mask loaded. A bit hacky.
this.contentHeight = this.$refs.animatedText.scrollHeight const newImg = new Image()
}, 1000) newImg.onload = () => {
setTimeout(() => {
this.contentHeight = this.$refs.animatedText.scrollHeight
}, 100)
}
newImg.src = this.pleromaTanVariant === pleromaTan ? pleromaTanMask : pleromaTanFoxMask
} }
} }