Skip to content

Commit a2cc1b8

Browse files
authored
fix: display premium banner on audit page when license inactive (coder#16713)
Fixes: coder#14798
1 parent c5a265f commit a2cc1b8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

site/src/pages/AuditPage/AuditPage.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ import { AuditPageView } from "./AuditPageView";
1616

1717
const AuditPage: FC = () => {
1818
const feats = useFeatureVisibility();
19+
// The "else false" is required if audit_log is undefined.
20+
// It may happen if owner removes the license.
21+
//
22+
// see: https://github.com/coder/coder/issues/14798
23+
const isAuditLogVisible = feats.audit_log || false;
24+
1925
const { showOrganizations } = useDashboard();
2026

2127
/**
@@ -85,7 +91,7 @@ const AuditPage: FC = () => {
8591
<AuditPageView
8692
auditLogs={auditsQuery.data?.audit_logs}
8793
isNonInitialPage={isNonInitialPage(searchParams)}
88-
isAuditLogVisible={feats.audit_log}
94+
isAuditLogVisible={isAuditLogVisible}
8995
auditsQuery={auditsQuery}
9096
error={auditsQuery.error}
9197
showOrgDetails={showOrganizations}

0 commit comments

Comments
 (0)