mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-25 15:56:19 -05:00
Submit button avoid flicker on actionReload
This commit is contained in:
parent
09545f97f0
commit
700ed935cc
|
|
@ -23,8 +23,12 @@ export function SubmitButton(
|
|||
}, [actionData]);
|
||||
|
||||
const isLoading = (): boolean => {
|
||||
if (transition.type !== "actionSubmission") return false;
|
||||
// is there an action happening at the moment?
|
||||
if (!["actionSubmission", "actionReload"].includes(transition.type)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// is it the action of this submit button?
|
||||
const _action = transition.submission?.formData.get("_action");
|
||||
if (_action !== actionType) return false;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user