From da3b134d1870c124cd15b00144b5c9cba7893219 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Tue, 23 Apr 2024 23:49:14 +0900 Subject: [PATCH] TMP: feat: scroll to top after loading new items by `.` shortcut key but this is not working when `showNewItems()` takes time --- plugins/magic-keys.client.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/magic-keys.client.ts b/plugins/magic-keys.client.ts index 2c885347..41f53243 100644 --- a/plugins/magic-keys.client.ts +++ b/plugins/magic-keys.client.ts @@ -75,5 +75,8 @@ export default defineNuxtPlugin(({ $scrollToTop }) => { ?.querySelector('button#elk_show_new_items') ?.click() } - whenever(logicAnd(isAuthenticated, notUsingInput, keys['.']), showNewItems) + whenever(logicAnd(isAuthenticated, notUsingInput, keys['.']), () => { + showNewItems() + ;($scrollToTop as () => void)() + }) })