Skip to content

Commit ff25d0b

Browse files
authored
Fix the Personal Tokens count & redirect when adding a token (#187)
This fixes two things: - the PAT count would not use the active filters - adding a PAT would remove the active filters
2 parents 442e9dd + 602970d commit ff25d0b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/routes/_console.personal-tokens.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,10 @@ const PersonalTokenAddButton = ({
288288
});
289289

290290
await navigate({
291-
to: "/personal-tokens/$tokenId",
291+
to: "./$tokenId",
292292
params: { tokenId: result.data.id },
293+
// Keep existing search parameters
294+
search: (previous) => previous,
293295
});
294296
},
295297
});
@@ -666,7 +668,10 @@ const UserCell = ({ userId, serverName }: UserCellProps) => {
666668
};
667669

668670
const PersonalTokenCount = ({ serverName }: { serverName: string }) => {
669-
const { data } = useSuspenseQuery(personalSessionsCountQuery(serverName));
671+
const { parameters } = Route.useLoaderDeps();
672+
const { data } = useSuspenseQuery(
673+
personalSessionsCountQuery(serverName, parameters),
674+
);
670675

671676
return (
672677
<FormattedMessage

0 commit comments

Comments
 (0)