Skip to content

Commit 0ee90f7

Browse files
committed
fix batch list page navigation
1 parent 8d67a4b commit 0ee90f7

File tree

1 file changed

+7
-3
lines changed
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.batches

1 file changed

+7
-3
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.batches/route.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ArrowRightIcon, ExclamationCircleIcon } from "@heroicons/react/20/solid";
22
import { BookOpenIcon } from "@heroicons/react/24/solid";
3-
import { type MetaFunction, Outlet, useNavigation, useParams } from "@remix-run/react";
3+
import { type MetaFunction, Outlet, useNavigation, useParams, useLocation } from "@remix-run/react";
44
import { type LoaderFunctionArgs } from "@remix-run/server-runtime";
55
import { formatDuration } from "@trigger.dev/core/v3/utils/durations";
66
import { typedjson, useTypedLoaderData } from "remix-typedjson";
@@ -160,7 +160,10 @@ export default function Page() {
160160

161161
function BatchesTable({ batches, hasFilters, filters }: BatchList) {
162162
const navigation = useNavigation();
163-
const isLoading = navigation.state !== "idle";
163+
const location = useLocation();
164+
const isLoading =
165+
navigation.state !== "idle" && navigation.location?.pathname === location.pathname;
166+
164167
const organization = useOrganization();
165168
const project = useProject();
166169
const environment = useEnvironment();
@@ -210,7 +213,8 @@ function BatchesTable({ batches, hasFilters, filters }: BatchList) {
210213
</TableBlankRow>
211214
) : (
212215
batches.map((batch) => {
213-
const inspectorPath = v3BatchPath(organization, project, environment, batch);
216+
const basePath = v3BatchPath(organization, project, environment, batch);
217+
const inspectorPath = `${basePath}${location.search}`;
214218
const runsPath = v3BatchRunsPath(organization, project, environment, batch);
215219
const isSelected = batchParam === batch.friendlyId;
216220

0 commit comments

Comments
 (0)