Files
triggerdotdev--trigger.dev/apps/webapp/app/hooks/useOptimisticLocation.ts
Matt Aitken d1092fcd2c
🚀 Publish Trigger.dev Docker / typecheck (push) Failing after 3s
🚀 Publish Trigger.dev Docker / e2e (push) Failing after 3s
🚀 Publish Trigger.dev Docker / units (push) Failing after 4s
🚀 Publish Trigger.dev Docker / publish (push) Has been skipped
Run filtering now works on the job runs page too (#823)
* Run filtering is now shared: runs page and job runs page

* Use optimistic location

* Improved the type in the run status filter dropdown

* Organize imports
2024-01-03 15:50:45 +00:00

13 lines
298 B
TypeScript

import { useLocation, useNavigation } from "@remix-run/react";
export function useOptimisticLocation() {
const navigation = useNavigation();
const location = useLocation();
if (navigation.state === "idle" || !navigation.location) {
return location;
}
return navigation.location;
}