diff --git a/app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx b/app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx
index 5632df49161..ead35bf5466 100644
--- a/app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx
+++ b/app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx
@@ -134,7 +134,10 @@ function MenuDropdown(props: MenuDropdownProps): JSX.Element {
}
const trackEvent = useTrackEvent()
const { trackProtocolRunEvent } = useTrackProtocolRunEvent(runId, robotName)
- const { reset, isRunControlLoading } = useRunControls(runId, onResetSuccess)
+ const { reset, isResetRunLoading, isRunControlLoading } = useRunControls(
+ runId,
+ onResetSuccess
+ )
const { deleteRun } = useDeleteRunMutation()
const robot = useRobot(robotName)
const robotSerialNumber =
@@ -189,7 +192,18 @@ function MenuDropdown(props: MenuDropdownProps): JSX.Element {
}
data-testid="RecentProtocolRun_OverflowMenu_rerunNow"
>
- {t('rerun_now')}
+
+ {t('rerun_now')}
+ {isResetRunLoading ? (
+
+ ) : null}
+
{isRobotOnWrongVersionOfSoftware && (
diff --git a/app/src/organisms/ProtocolUpload/hooks/useCloneRun.ts b/app/src/organisms/ProtocolUpload/hooks/useCloneRun.ts
index d15bee033ed..870491b032c 100644
--- a/app/src/organisms/ProtocolUpload/hooks/useCloneRun.ts
+++ b/app/src/organisms/ProtocolUpload/hooks/useCloneRun.ts
@@ -36,13 +36,12 @@ export function useCloneRun(
'protocols',
protocolKey,
])
- Promise.all([invalidateRuns, invalidateProtocols])
- .then(() => {
- onSuccessCallback?.(response)
- })
- .catch((e: Error) => {
- console.error(`error invalidating runs query: ${e.message}`)
- })
+ Promise.all([invalidateRuns, invalidateProtocols]).catch((e: Error) => {
+ console.error(`error invalidating runs query: ${e.message}`)
+ })
+ // The onSuccess callback is not awaited until query invalidation, because currently, in every instance this
+ // onSuccessCallback is utilized, we only use it for navigating. We may need to revisit this.
+ onSuccessCallback?.(response)
},
})
const { createProtocolAnalysis } = useCreateProtocolAnalysisMutation(