diff --git a/src/components/dashboard/PagesManager.tsx b/src/components/dashboard/PagesManager.tsx index 0e2ffa91..baf94f3b 100644 --- a/src/components/dashboard/PagesManager.tsx +++ b/src/components/dashboard/PagesManager.tsx @@ -191,10 +191,13 @@ export const PagesManager: React.FC<{ if (!page.metadata) { const toastId = toast.loading("Deleting...") delStorage(`draft-${subdomain}-${page.id}`) - queryClient.invalidateQueries(["getPagesBySite", subdomain]) - queryClient.invalidateQueries(["getPage", page.id]) - toast.success("Deleted!", { - id: toastId, + Promise.all([ + queryClient.refetchQueries(["getPagesBySite", subdomain]), + queryClient.refetchQueries(["getPage", page.id]), + ]).then(() => { + toast.success("Deleted!", { + id: toastId, + }) }) } else { setDeleteToastId(toast.loading("Deleting...")) diff --git a/src/pages/dashboard/[subdomain]/posts.tsx b/src/pages/dashboard/[subdomain]/posts.tsx index 1334c4b5..3648ff09 100644 --- a/src/pages/dashboard/[subdomain]/posts.tsx +++ b/src/pages/dashboard/[subdomain]/posts.tsx @@ -1,9 +1,8 @@ -import { DashboardLayout } from "~/components/dashboard/DashboardLayout" -import { PagesManager } from "~/components/dashboard/PagesManager" -import type { ReactElement } from "react" -import { useTranslation } from "next-i18next" -import { getServerSideProps as getLayoutServerSideProps } from "~/components/dashboard/DashboardLayout.server" import { GetServerSideProps } from "next" +import type { ReactElement } from "react" +import { DashboardLayout } from "~/components/dashboard/DashboardLayout" +import { getServerSideProps as getLayoutServerSideProps } from "~/components/dashboard/DashboardLayout.server" +import { PagesManager } from "~/components/dashboard/PagesManager" import { serverSidePropsHandler } from "~/lib/server-side-props" export const getServerSideProps: GetServerSideProps = serverSidePropsHandler(