Closed Suxsem closed 10 months ago
I always noticed that most of the time the card was initially empty and only after some time it was properly rendered. Sometimes the card wasn't rendering at all.
I spent some minutes on the code and found the issue:
https://github.com/amaximus/garbage-collection-card/blob/68971f98d6269d65b210d6171a288534f685a215/dist/garbage-collection-card.js#L273
was fired before
https://github.com/amaximus/garbage-collection-card/blob/68971f98d6269d65b210d6171a288534f685a215/dist/garbage-collection-card.js#L337
and thus the _updateContent method was not able to read this.source.
This PR fixes the issue by setting this.source on first load at soon as possible.
No more issues!
I always noticed that most of the time the card was initially empty and only after some time it was properly rendered. Sometimes the card wasn't rendering at all.
I spent some minutes on the code and found the issue:
https://github.com/amaximus/garbage-collection-card/blob/68971f98d6269d65b210d6171a288534f685a215/dist/garbage-collection-card.js#L273
was fired before
https://github.com/amaximus/garbage-collection-card/blob/68971f98d6269d65b210d6171a288534f685a215/dist/garbage-collection-card.js#L337
and thus the _updateContent method was not able to read this.source.
This PR fixes the issue by setting this.source on first load at soon as possible.
No more issues!