diff --git a/src/app/_components/InstalledScriptsTab.tsx b/src/app/_components/InstalledScriptsTab.tsx
index 3ba3107..cf369fa 100644
--- a/src/app/_components/InstalledScriptsTab.tsx
+++ b/src/app/_components/InstalledScriptsTab.tsx
@@ -322,7 +322,7 @@ export function InstalledScriptsTab() {
if (serverIds.length > 0) {
containerStatusMutation.mutate({ serverIds });
}
- }, []);
+ }, [containerStatusMutation]);
// Run cleanup when component mounts and scripts are loaded (only once)
useEffect(() => {
@@ -337,7 +337,7 @@ export function InstalledScriptsTab() {
if (scripts.length > 0) {
fetchContainerStatuses();
}
- }, [scripts.length]); // Only depend on scripts.length to prevent infinite loops
+ }, [scripts.length, fetchContainerStatuses]);
const scriptsWithStatus = scripts.map(script => ({
...script,
diff --git a/src/app/_components/ScriptsGrid.tsx b/src/app/_components/ScriptsGrid.tsx
index 9191aec..d2d22a6 100644
--- a/src/app/_components/ScriptsGrid.tsx
+++ b/src/app/_components/ScriptsGrid.tsx
@@ -571,7 +571,7 @@ export function ScriptsGrid({ onInstallScript }: ScriptsGridProps) {
);
}
- if (!scriptsWithStatus || scriptsWithStatus.length === 0) {
+ if (!scriptsWithStatus?.length) {
return (
diff --git a/src/lib/colorUtils.ts b/src/lib/colorUtils.ts
index 3e1fbd0..ddbb6f9 100644
--- a/src/lib/colorUtils.ts
+++ b/src/lib/colorUtils.ts
@@ -3,7 +3,7 @@
* to ensure optimal readability based on luminance
*/
export function getContrastColor(hexColor: string): 'black' | 'white' {
- if (!hexColor || hexColor.length !== 7 || !hexColor.startsWith('#')) {
+ if (!hexColor?.length || hexColor.length !== 7 || !hexColor.startsWith('#')) {
return 'black'; // Default to black for invalid colors
}