This commit is contained in:
Maze Winther 2025-07-16 22:49:10 +02:00
parent accad442f4
commit 7d1f99c20c
2 changed files with 2 additions and 21 deletions

View File

@ -1,8 +1,7 @@
"use client"
import { redirect } from "next/navigation";
"use client";
import Link from "next/link";
import React, { useState } from "react";
import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import { Checkbox } from "@/components/ui/checkbox";
@ -29,15 +28,8 @@ import { useProjectStore } from "@/stores/project-store";
import { useRouter } from "next/navigation";
import { DeleteProjectDialog } from "@/components/delete-project-dialog";
import { RenameProjectDialog } from "@/components/rename-project-dialog";
import { toast } from "sonner";
export default function ProjectsPage() {
if (process.env.NODE_ENV !== "development") {
toast.error("You are not allowed to access this page");
redirect("/");
}
const {
createNewProject,
savedProjects,

View File

@ -5,7 +5,6 @@ import { toast } from "sonner";
import { useMediaStore } from "./media-store";
import { useTimelineStore } from "./timeline-store";
import { generateUUID } from "@/lib/utils";
import { env } from "@/env";
interface ProjectStore {
activeProject: TProject | null;
@ -37,16 +36,6 @@ export const useProjectStore = create<ProjectStore>((set, get) => ({
isInitialized: false,
createNewProject: async (name: string) => {
try {
if (process.env.NODE_ENV !== "development") {
toast.error("Project creation is disabled outside development environment");
throw new Error("Not allowed in production");
}
} catch (error) {
toast.error("Failed to create new project");
throw error;
}
const newProject: TProject = {
id: generateUUID(),
name,