diff --git a/src/components/settings/EmailChangeDialog.tsx b/src/components/settings/EmailChangeDialog.tsx
index 9283629f..d36b01ef 100644
--- a/src/components/settings/EmailChangeDialog.tsx
+++ b/src/components/settings/EmailChangeDialog.tsx
@@ -253,7 +253,7 @@ export function EmailChangeDialog({ open, onOpenChange, currentEmail, userId }:
metadata: {
currentEmail,
newEmail: data.newEmail,
- errorType: error.constructor.name
+ errorType: error instanceof Error ? error.constructor.name : 'Unknown'
}
}
);
diff --git a/src/components/ui/sidebar.tsx b/src/components/ui/sidebar.tsx
index 37ea9ff6..dd067989 100644
--- a/src/components/ui/sidebar.tsx
+++ b/src/components/ui/sidebar.tsx
@@ -78,7 +78,7 @@ const SidebarProvider = React.forwardRef<
state,
open,
setOpen,
- isMobile,
+ isMobile: isMobile ?? false,
openMobile,
setOpenMobile,
toggleSidebar,
diff --git a/src/components/upload/EntityMultiImageUploader.tsx b/src/components/upload/EntityMultiImageUploader.tsx
index ceee256e..497fd939 100644
--- a/src/components/upload/EntityMultiImageUploader.tsx
+++ b/src/components/upload/EntityMultiImageUploader.tsx
@@ -86,7 +86,7 @@ export function EntityMultiImageUploader({
.from('photos')
.select('id, cloudflare_image_url, cloudflare_image_id, caption, title')
.eq('entity_type', entityType)
- .eq('entity_id', entityId)
+ .eq('entity_id', entityId || '')
.order('created_at', { ascending: false });
if (error) throw error;
@@ -314,7 +314,7 @@ export function EntityMultiImageUploader({
const existingCount = value.uploaded.filter(img => !img.isLocal).length;
const newCount = value.uploaded.filter(img => img.isLocal).length;
- const parts = [];
+ const parts: string[] = [];
if (mode === 'edit' && existingCount > 0) {
parts.push(`${existingCount} existing photo${existingCount !== 1 ? 's' : ''}`);
diff --git a/src/components/upload/EntityPhotoGallery.tsx b/src/components/upload/EntityPhotoGallery.tsx
index ac775991..c6ff02e3 100644
--- a/src/components/upload/EntityPhotoGallery.tsx
+++ b/src/components/upload/EntityPhotoGallery.tsx
@@ -68,7 +68,7 @@ export function EntityPhotoGallery({
url: photo.cloudflare_image_url,
caption: photo.caption || undefined,
title: photo.title || undefined,
- user_id: photo.submitted_by,
+ user_id: photo.submitted_by || '',
created_at: photo.created_at,
})) || [];
@@ -148,7 +148,7 @@ export function EntityPhotoGallery({
- {isModerator && photos.length > 0 && (
+ {isModerator() && photos.length > 0 && (