mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
fix
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
"use client"
|
"use client";
|
||||||
import { redirect } from "next/navigation";
|
|
||||||
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Card, CardContent } from "@/components/ui/card";
|
import { Card, CardContent } from "@/components/ui/card";
|
||||||
import { Checkbox } from "@/components/ui/checkbox";
|
import { Checkbox } from "@/components/ui/checkbox";
|
||||||
@@ -29,15 +28,8 @@ import { useProjectStore } from "@/stores/project-store";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { DeleteProjectDialog } from "@/components/delete-project-dialog";
|
import { DeleteProjectDialog } from "@/components/delete-project-dialog";
|
||||||
import { RenameProjectDialog } from "@/components/rename-project-dialog";
|
import { RenameProjectDialog } from "@/components/rename-project-dialog";
|
||||||
import { toast } from "sonner";
|
|
||||||
|
|
||||||
export default function ProjectsPage() {
|
export default function ProjectsPage() {
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== "development") {
|
|
||||||
toast.error("You are not allowed to access this page");
|
|
||||||
redirect("/");
|
|
||||||
}
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
createNewProject,
|
createNewProject,
|
||||||
savedProjects,
|
savedProjects,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { toast } from "sonner";
|
|||||||
import { useMediaStore } from "./media-store";
|
import { useMediaStore } from "./media-store";
|
||||||
import { useTimelineStore } from "./timeline-store";
|
import { useTimelineStore } from "./timeline-store";
|
||||||
import { generateUUID } from "@/lib/utils";
|
import { generateUUID } from "@/lib/utils";
|
||||||
import { env } from "@/env";
|
|
||||||
|
|
||||||
interface ProjectStore {
|
interface ProjectStore {
|
||||||
activeProject: TProject | null;
|
activeProject: TProject | null;
|
||||||
@@ -37,16 +36,6 @@ export const useProjectStore = create<ProjectStore>((set, get) => ({
|
|||||||
isInitialized: false,
|
isInitialized: false,
|
||||||
|
|
||||||
createNewProject: async (name: string) => {
|
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 = {
|
const newProject: TProject = {
|
||||||
id: generateUUID(),
|
id: generateUUID(),
|
||||||
name,
|
name,
|
||||||
|
|||||||
Reference in New Issue
Block a user