Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
Merge branch 'main' of github.com:arthyn/taisho
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunter Miller committed May 7, 2021
2 parents 3c1862e + da46d2d commit 0ba7aa9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/renderer/ship/Ship.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,15 @@ export const Ship: React.FC = () => {
}
})
const { mutate: ejectShip, isLoading } = useMutation(async () => {
await send('stop-pier', ship)
return send('eject-pier', ship)
const pier = await send('stop-pier', ship)

//we wait here in case .vere.lock hasn't cleared yet (race condition)
return new Promise<void>((resolve) => {
setTimeout(async () => {
await send('eject-pier', pier)
resolve();
}, 2000)
})
}, {
onSuccess: () => {
queryClient.prefetchQuery(pierKey())
Expand Down

0 comments on commit 0ba7aa9

Please sign in to comment.