I have created a preloader for my website although i never had an issue like this before and i started using Turbolinks which maybe is causing this issue but it shouldn't.
Pace.on('done', () => {
doneLoad()
})
function doneLoad() {
gsap.timeline()
.set('html, body', {
overflowY: 'unset'
})
.set('#app, #__footer', {
visibility: 'visible',
}, 'add')
.add('do')
.to('.turbo__lines', {
stagger: .3,
height: '0%'
})
.to('.turbo__logo, .__loader', {
duration: .3,
opacity: 0
}, 'do')
.to('.turbo__loader', {
visibility: 'hidden'
})
}
So when the loading is finished on my website the function doneLoad() is called most of the times it fires correctly, but there are times that it doesn't fire for some reason, no errors, and the loader just stays forever.
Am i doing anything wrong with the above code?