summaryrefslogtreecommitdiff
path: root/apps/web/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/src/app')
-rw-r--r--apps/web/src/app/editor/[project_id]/page.tsx27
1 files changed, 19 insertions, 8 deletions
diff --git a/apps/web/src/app/editor/[project_id]/page.tsx b/apps/web/src/app/editor/[project_id]/page.tsx
index 3378d11d..5e294fe7 100644
--- a/apps/web/src/app/editor/[project_id]/page.tsx
+++ b/apps/web/src/app/editor/[project_id]/page.tsx
@@ -65,7 +65,7 @@ export default function Editor() {
return;
}
- // Check global invalid tracking FIRST (most important for preventing duplicates)
+ // Check global invalid tracking first (most important for preventing duplicates)
if (isInvalidProjectId(projectId)) {
return;
}
@@ -96,10 +96,11 @@ export default function Editor() {
}
// More specific error handling - only create new project for actual "not found" errors
- const isProjectNotFound = error instanceof Error &&
- (error.message.includes('not found') ||
- error.message.includes('does not exist') ||
- error.message.includes('Project not found'));
+ const isProjectNotFound =
+ error instanceof Error &&
+ (error.message.includes("not found") ||
+ error.message.includes("does not exist") ||
+ error.message.includes("Project not found"));
if (isProjectNotFound) {
// Mark this project ID as invalid globally BEFORE creating project
@@ -118,8 +119,11 @@ export default function Editor() {
console.error("Failed to create new project:", createError);
}
} else {
- // For other errors (storage issues, corruption, etc.), log but don't create new project
- console.error("Project loading failed with recoverable error:", error);
+ // For other errors (storage issues, corruption, etc.), don't create new project
+ console.error(
+ "Project loading failed with recoverable error:",
+ error
+ );
// Remove from handled set so user can retry
handledProjectIds.current.delete(projectId);
}
@@ -135,7 +139,14 @@ export default function Editor() {
isCancelled = true;
isInitializingRef.current = false;
};
- }, [projectId, loadProject, createNewProject, router]); // Removed activeProject?.id dependency
+ }, [
+ projectId,
+ loadProject,
+ createNewProject,
+ router,
+ isInvalidProjectId,
+ markProjectIdAsInvalid,
+ ]);
return (
<EditorProvider>