Skip to content

Commit

Permalink
Move to the note page when created
Browse files Browse the repository at this point in the history
  • Loading branch information
devleejb committed Jan 24, 2024
1 parent e2c980e commit a6d9ed8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/components/drawers/WorkspaceDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { useSelector } from "react-redux";
import { selectUser } from "../../store/userSlice";
import { MouseEventHandler, useState } from "react";
import ProfilePopover from "../popovers/ProfilePopover";
import { useParams } from "react-router-dom";
import { useNavigate, useParams } from "react-router-dom";
import { useGetWorkspaceQuery } from "../../hooks/api/workspace";
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
Expand All @@ -32,6 +32,7 @@ import MemberModal from "../modals/MemberModal";
const DRAWER_WIDTH = 240;

function WorkspaceDrawer() {
const navigate = useNavigate();
const params = useParams();
const userStore = useSelector(selectUser);
const { data: workspace } = useGetWorkspaceQuery(params.workspaceSlug);
Expand Down Expand Up @@ -60,7 +61,9 @@ function WorkspaceDrawer() {
};

const handleCreateWorkspace = async (data: { title: string }) => {
await createDocument(data);
const document = await createDocument(data);

navigate(document.id);
};

const handleCreateWorkspaceModalOpen = () => {
Expand Down

0 comments on commit a6d9ed8

Please sign in to comment.