TMP: feat: scroll to top after loading new items by . shortcut key but this is not working when showNewItems() takes time

This commit is contained in:
TAKAHASHI Shuuji 2024-04-23 23:49:14 +09:00
parent 8ad05dfd47
commit da3b134d18
No known key found for this signature in database
GPG key ID: F15C887632129F5E

View file

@ -75,5 +75,8 @@ export default defineNuxtPlugin(({ $scrollToTop }) => {
?.querySelector<HTMLElement>('button#elk_show_new_items')
?.click()
}
whenever(logicAnd(isAuthenticated, notUsingInput, keys['.']), showNewItems)
whenever(logicAnd(isAuthenticated, notUsingInput, keys['.']), () => {
showNewItems()
;($scrollToTop as () => void)()
})
})