fix: TypeScript errors blocking production build
- Replace process.env.NODE_ENV with import.meta.env.DEV (Vite compatible) - Fix undefined not assignable to boolean|null with nullish coalescing
This commit is contained in:
@@ -62,7 +62,7 @@ export default class ErrorBoundary extends Component<Props, State> {
|
|||||||
return to the dashboard.
|
return to the dashboard.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{process.env.NODE_ENV === "development" && this.state.error && (
|
{import.meta.env.DEV && this.state.error && (
|
||||||
<details className="mt-4 w-full text-left">
|
<details className="mt-4 w-full text-left">
|
||||||
<summary className="cursor-pointer text-sm text-gray-500 hover:text-gray-300">
|
<summary className="cursor-pointer text-sm text-gray-500 hover:text-gray-300">
|
||||||
Error details
|
Error details
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ export default function DetectionRuleChecklist({ testId, user, canEdit }: Props)
|
|||||||
className="flex-1 rounded border border-gray-700 bg-gray-900 px-2 py-1.5 text-xs text-gray-200 placeholder-gray-500 focus:border-indigo-500 focus:outline-none"
|
className="flex-1 rounded border border-gray-700 bg-gray-900 px-2 py-1.5 text-xs text-gray-200 placeholder-gray-500 focus:border-indigo-500 focus:outline-none"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
onClick={() => handleNotesSave(rule.id, rule.triggered)}
|
onClick={() => handleNotesSave(rule.id, rule.triggered ?? null)}
|
||||||
disabled={evaluateMutation.isPending}
|
disabled={evaluateMutation.isPending}
|
||||||
className="shrink-0 rounded bg-indigo-600 px-2 py-1.5 text-xs font-medium text-white hover:bg-indigo-500 disabled:opacity-50"
|
className="shrink-0 rounded bg-indigo-600 px-2 py-1.5 text-xs font-medium text-white hover:bg-indigo-500 disabled:opacity-50"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user