From ba9772a0e0199d8094bc47172325c8d813f27525 Mon Sep 17 00:00:00 2001 From: Preston Date: Thu, 10 Feb 2022 18:09:33 -0500 Subject: [PATCH] Replace timeout with Vue ticks --- src/renderer/views/UserPlaylists/UserPlaylists.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/renderer/views/UserPlaylists/UserPlaylists.js b/src/renderer/views/UserPlaylists/UserPlaylists.js index 85b3df1b..f69be7ed 100644 --- a/src/renderer/views/UserPlaylists/UserPlaylists.js +++ b/src/renderer/views/UserPlaylists/UserPlaylists.js @@ -47,13 +47,12 @@ export default Vue.extend({ activeData() { const scrollPos = window.scrollY || window.scrollTop || document.getElementsByTagName('html')[0].scrollTop this.isLoading = true - setTimeout(() => { + Vue.nextTick(() => { this.isLoading = false - // This is kinda ugly, but should fix a few existing issues - setTimeout(() => { + Vue.nextTick(() => { window.scrollTo(0, scrollPos) - }, 200) - }, 100) + }) + }) } }, mounted: function () {