Submit fix (#4978)

* Fix submit logic

* Fix type

* Align submit task creation 1:1 with callsites

* blegh. `useThrottledValue`

* make `useThrottledValue`'s time required

---------

Co-authored-by: Hailey <me@haileyok.com>
This commit is contained in:
dan 2024-08-22 22:43:23 +01:00 committed by GitHub
parent df5bf28e61
commit 27bb383268
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 46 additions and 32 deletions

View file

@ -2,7 +2,7 @@ import {useEffect, useRef, useState} from 'react'
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
export function useThrottledValue<T>(value: T, time?: number) {
export function useThrottledValue<T>(value: T, time: number) {
const pendingValueRef = useRef(value)
const [throttledValue, setThrottledValue] = useState(value)