logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 6e1639cc1e0f15760fdb26786c28fca4c3fd8c17
parent 420f29b6a460ead0a5b4d9ff61e3d3ca097bd798
Author: Henry Jameson <me@hjkos.com>
Date:   Tue, 23 Aug 2022 02:06:54 +0300

fetch text height only after mask has been loaded

Diffstat:

Msrc/components/update_notification/update_notification.js11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 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 } }