Skip to content

Commit

Permalink
Merge branch 'main' into link-webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey authored Oct 14, 2024
2 parents e7ef8a4 + c61b682 commit 095e141
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion apps/web/ui/modals/delete-workspace-modal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import useWorkspace from "@/lib/swr/use-workspace";
import { Button, Logo, Modal, useMediaQuery } from "@dub/ui";
import { cn } from "@dub/utils";
import { useSession } from "next-auth/react";
import { useParams, useRouter } from "next/navigation";
import {
Dispatch,
Expand All @@ -19,6 +20,7 @@ function DeleteWorkspaceModal({
showDeleteWorkspaceModal: boolean;
setShowDeleteWorkspaceModal: Dispatch<SetStateAction<boolean>>;
}) {
const { update } = useSession();
const router = useRouter();
const { slug } = useParams() as { slug: string };
const { id, isOwner } = useWorkspace();
Expand All @@ -35,7 +37,7 @@ function DeleteWorkspaceModal({
},
}).then(async (res) => {
if (res.ok) {
await mutate("/api/workspaces");
await Promise.all([mutate("/api/workspaces"), update()]);
router.push("/");
resolve(null);
} else {
Expand Down
4 changes: 3 additions & 1 deletion apps/web/ui/workspaces/create-workspace-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { AlertCircleFill } from "@/ui/shared/icons";
import { Button, InfoTooltip, useMediaQuery } from "@dub/ui";
import { cn } from "@dub/utils";
import slugify from "@sindresorhus/slugify";
import { useSession } from "next-auth/react";
import { usePlausible } from "next-plausible";
import posthog from "posthog-js";
import { useForm } from "react-hook-form";
Expand All @@ -22,6 +23,7 @@ export function CreateWorkspaceForm({
onSuccess?: (data: FormData) => void;
className?: string;
}) {
const { update } = useSession();
const plausible = usePlausible();

const {
Expand Down Expand Up @@ -59,7 +61,7 @@ export function CreateWorkspaceForm({
workspace_name: data.name,
workspace_slug: data.slug,
});
await mutate("/api/workspaces");
await Promise.all([mutate("/api/workspaces"), update()]);
onSuccess?.(data);
} else {
const { error } = await res.json();
Expand Down

0 comments on commit 095e141

Please sign in to comment.