Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix: fixed but when preloading a workspace / project

Andrej19f3136e1209
diff --git a/apps/web/src/components/project/select-project-state.tsx b/apps/web/src/components/project/select-project-state.tsx
index 7eeda8c01..12da6501c 100644
--- a/apps/web/src/components/project/select-project-state.tsx
+++ b/apps/web/src/components/project/select-project-state.tsx
@@ -1,5 +1,5 @@
import { motion } from "framer-motion";
-import { ArrowRight, LayoutGrid } from "lucide-react";
+import { ArrowLeft, LayoutGrid } from "lucide-react";
function SelectProjectState() {
return (
@@ -24,7 +24,7 @@ function SelectProjectState() {
<LayoutGrid className="w-8 h-8 text-indigo-500 dark:text-indigo-400" />
</motion.div>
<motion.div
- className="absolute -right-4 top-1/2 -translate-y-1/2"
+ className="absolute -left-4 top-1/2 -translate-y-1/2"
animate={{ x: [0, 5, 0] }}
transition={{
duration: 2,
@@ -33,7 +33,7 @@ function SelectProjectState() {
delay: 0.5,
}}
>
- <ArrowRight className="w-5 h-5 text-indigo-400 dark:text-indigo-300" />
+ <ArrowLeft className="w-5 h-5 text-indigo-400 dark:text-indigo-300" />
</motion.div>
</div>
<h1 className="text-2xl font-semibold text-zinc-900 dark:text-zinc-100 mb-3">
diff --git a/apps/web/src/routes/dashboard.tsx b/apps/web/src/routes/dashboard.tsx
index cc3c03fd4..23d39ba69 100644
--- a/apps/web/src/routes/dashboard.tsx
+++ b/apps/web/src/routes/dashboard.tsx
@@ -28,7 +28,10 @@ function DashboardIndexRouteComponent() {
<Sidebar />
<main className="flex-1 overflow-hidden scroll-smooth">
{hasNoWorkspacesAndNoSelectedWorkspace && <EmptyWorkspaceState />}
- {workspace ? <Outlet /> : <SelectWorkspaceState />}
+ {!workspace && workspaces && workspaces.length > 0 && (
+ <SelectWorkspaceState />
+ )}
+ <Outlet />
</main>
</>
);
diff --git a/apps/web/src/routes/dashboard/workspace/$workspaceId.tsx b/apps/web/src/routes/dashboard/workspace/$workspaceId.tsx
index 8d5a0fdca..a25d6ef51 100644
--- a/apps/web/src/routes/dashboard/workspace/$workspaceId.tsx
+++ b/apps/web/src/routes/dashboard/workspace/$workspaceId.tsx
@@ -5,7 +5,6 @@ import useGetWorkspace from "@/hooks/queries/workspace/use-get-workspace";
import useProjectStore from "@/store/project";
import useWorkspaceStore from "@/store/workspace";
import { Outlet, createFileRoute } from "@tanstack/react-router";
-import { LayoutGrid } from "lucide-react";
import { useEffect } from "react";
export const Route = createFileRoute("/dashboard/workspace/$workspaceId")({
@@ -14,10 +13,14 @@ export const Route = createFileRoute("/dashboard/workspace/$workspaceId")({
function RouteComponent() {
const { workspaceId } = Route.useParams();
- const { data, isLoading } = useGetWorkspace({ workspaceId });
- const { workspace, setWorkspace } = useWorkspaceStore();
+ const { data } = useGetWorkspace({
+ workspaceId,
+ });
+ const { setWorkspace } = useWorkspaceStore();
const { project } = useProjectStore();
- const { data: projects } = useGetProjects({ workspaceId });
+ const { data: projects } = useGetProjects({
+ workspaceId,
+ });
useEffect(() => {
if (data) {
@@ -25,23 +28,14 @@ function RouteComponent() {
}
}, [data, setWorkspace]);
- if (isLoading) {
- return (
- <div className="flex w-full items-center justify-center h-screen flex-col md:flex-row bg-zinc-50 dark:bg-zinc-950">
- <div className="p-1.5 bg-linear-to-br from-indigo-500 to-purple-500 rounded-lg shadow-xs animate-spin">
- <LayoutGrid className="w-5 h-5 text-white" />
- </div>
- </div>
- );
- }
-
if (projects && projects.length === 0) {
return <EmptyProjectState />;
}
- if (workspace && !project) {
- return <SelectProjectState />;
- }
-
- return <Outlet />;
+ return (
+ <>
+ <Outlet />
+ {!project && <SelectProjectState />}
+ </>
+ );
}
diff --git a/apps/web/src/routes/dashboard/workspace/$workspaceId/project/$projectId/board.tsx b/apps/web/src/routes/dashboard/workspace/$workspaceId/project/$projectId/board.tsx
index 40a7ed50c..95a5ee350 100644
--- a/apps/web/src/routes/dashboard/workspace/$workspaceId/project/$projectId/board.tsx
+++ b/apps/web/src/routes/dashboard/workspace/$workspaceId/project/$projectId/board.tsx
@@ -2,7 +2,6 @@ import KanbanBoard from "@/components/kanban-board";
import useGetProject from "@/hooks/queries/project/use-get-project";
import useProjectStore from "@/store/project";
import { createFileRoute } from "@tanstack/react-router";
-import { LayoutGrid } from "lucide-react";
import { useEffect } from "react";
export const Route = createFileRoute(
@@ -13,7 +12,7 @@ export const Route = createFileRoute(
function RouteComponent() {
const { workspaceId, projectId } = Route.useParams();
- const { data, isFetching } = useGetProject({ id: projectId, workspaceId });
+ const { data } = useGetProject({ id: projectId, workspaceId });
const { setProject } = useProjectStore();
useEffect(() => {
@@ -22,16 +21,6 @@ function RouteComponent() {
}
}, [data, setProject]);
- if (isFetching) {
- return (
- <div className="flex w-full items-center justify-center h-screen flex-col md:flex-row bg-zinc-50 dark:bg-zinc-950">
- <div className="p-1.5 bg-linear-to-br from-indigo-500 to-purple-500 rounded-lg shadow-xs animate-spin">
- <LayoutGrid className="w-5 h-5 text-white" />
- </div>
- </div>
- );
- }
-
return (
<div className="h-full pr-6 pt-6 pb-6">
<KanbanBoard />
diff --git a/bun.lockb b/bun.lockb
index 69c418116..637709812 100755
Binary files a/bun.lockb and b/bun.lockb differ