Skip to content

Commit f4734e6

Browse files
committed
duplicate shortcut and user session fetching fix
1 parent ddd0c11 commit f4734e6

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

apps/webapp/app/components/logs/LogDetailView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ export function LogDetailView({ logId, initialLog, onClose, searchTerm }: LogDet
117117

118118
if (e.key === "Escape") {
119119
onClose();
120-
} else if ((e.key === "v" || e.key === "V") && !e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey && !isLoading && log) {
121-
window.open(runPath, "_blank");
122120
}
123121
};
124122
window.addEventListener("keydown", handleKeyDown);

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.logs.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ function parseLevelsFromUrl(url: URL): LogLevel[] | undefined {
1919
}
2020

2121
export const loader = async ({ request, params }: LoaderFunctionArgs) => {
22-
const userId = await requireUserId(request);
22+
const user = await requireUser(request);
23+
const userId = user.id;
24+
const isAdmin = user?.admin || user?.isImpersonating;
25+
2326
const { projectParam, organizationSlug, envParam } = EnvironmentParamSchema.parse(params);
2427

2528
const project = await findProjectBySlug(organizationSlug, projectParam, userId);
@@ -32,9 +35,6 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
3235
throw new Response("Environment not found", { status: 404 });
3336
}
3437

35-
const user = await requireUser(request);
36-
const isAdmin = user?.admin || user?.isImpersonating;
37-
3838
// Get the user's plan to determine log retention limit
3939
const plan = await getCurrentPlan(project.organizationId);
4040
const retentionLimitDays = plan?.v3Subscription?.plan?.limits.logRetentionDays.number ?? 30;

0 commit comments

Comments
 (0)