Explorar o código

feat: limit key fps on development as it's slower

Fela Maslen %!s(int64=5) %!d(string=hai) anos
pai
achega
8a376f77d5
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      gmus-web/src/hooks/vim.ts

+ 5 - 1
gmus-web/src/hooks/vim.ts

@@ -49,7 +49,11 @@ export function useVimBindings(dispatch: Dispatch<ActionKeyPressed>, skip = fals
     [dispatch],
   );
 
-  const listenerThrottled = useThrottleCallback(listener, 60, true);
+  const listenerThrottled = useThrottleCallback(
+    listener,
+    process.env.NODE_ENV === 'development' ? 15 : 60,
+    true,
+  );
 
   useEffect(() => {
     if (skip) {