Skip to content

Commit fc947a9

Browse files
Button fix
1 parent c0508b5 commit fc947a9

File tree

1 file changed

+9
-9
lines changed
  • app/gui/src/dashboard/components/AriaComponents/Button

1 file changed

+9
-9
lines changed

app/gui/src/dashboard/components/AriaComponents/Button/Button.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,19 @@ export function Button<IconType extends string>(propsReplacement: ButtonProps<Ic
142142
}, [isLoadingFinal, loaderPosition])
143143

144144
const handlePress = useEventCallback((event: aria.PressEvent): void => {
145-
setImplicitlyLoading(async () => {
146-
if (!isDisabled) {
147-
const result = onPress?.(event)
145+
if (!isDisabled) {
146+
const result = onPress?.(event)
148147

149-
if (result instanceof Promise) {
148+
if (result instanceof Promise) {
149+
setImplicitlyLoading(async () => {
150150
await result
151-
}
151+
})
152+
}
152153

153-
if (dialogContext != null && 'formMethod' in props && props.formMethod === 'dialog') {
154-
dialogContext.close()
155-
}
154+
if (dialogContext != null && 'formMethod' in props && props.formMethod === 'dialog') {
155+
dialogContext.close()
156156
}
157-
})
157+
}
158158
})
159159

160160
const styles = variants({

0 commit comments

Comments
 (0)