Skip to content

Commit 34e2370

Browse files
committed
ui: Don't error if no supabase in local mode
1 parent 23d010f commit 34e2370

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

ui/src/layouts/ProjectLayout.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ export const ProjectLayout: React.FC = () => {
2727
// Validate that the selected project ID exists in the fetched projects
2828
// If it doesn't exist (e.g., from old localStorage), clear it
2929
if (selectedProjectId && userProjects.length > 0) {
30-
const projectExists = userProjects.some(p => p.id === selectedProjectId);
30+
const projectExists = userProjects.some(
31+
(p) => p.id === selectedProjectId
32+
);
3133
if (!projectExists) {
3234
// Old project ID doesn't exist, clear it and use first project
33-
console.warn(`Project ID ${selectedProjectId} not found in projects, clearing selection`);
35+
console.warn(
36+
`Project ID ${selectedProjectId} not found in projects, clearing selection`
37+
);
3438
setSelectedProjectId(userProjects[0].id);
3539
}
3640
} else if (userProjects.length > 0 && !selectedProjectId) {

ui/src/lib/supabase.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if (!isLocalMode()) {
1313

1414
// Create Supabase client only if we have the required variables
1515
// In local mode, this will be null/undefined, which should be handled by the app
16-
export const supabase = supabaseUrl && supabaseAnonKey
17-
? createClient(supabaseUrl, supabaseAnonKey)
18-
: null;
16+
export const supabase =
17+
supabaseUrl && supabaseAnonKey
18+
? createClient(supabaseUrl, supabaseAnonKey)
19+
: null;

0 commit comments

Comments
 (0)