Skip to content

Commit 283344f

Browse files
committed
Fixed a few errors with new admin wrapper
1 parent 0916bbc commit 283344f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/app/[sdSlug]/admin/video/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
import { ConfigHelper } from "@/helpers";
1+
"use server";
2+
3+
import { ConfigHelper, EnvironmentHelper } from "@/helpers";
24
import { ManageVideoClient } from "./ManageVideoClient";
35

46

57
type Params = Promise<{ sdSlug: string }>;
68

79

810
export default async function ManageVideoPage({ params }: { params: Params}) {
9-
const {sdSlug}= await params
11+
await EnvironmentHelper.initServerSide();
12+
const {sdSlug}= await params
13+
1014
const config = await ConfigHelper.load(sdSlug.toString());
1115
return <ManageVideoClient config={config} />;
1216
}

src/components/admin/AdminHeader.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ import { SiteHeader } from "@churchapps/apphelper";
66

77
import UserContext from "@/context/UserContext";
88
import { SecondaryMenuHelper } from "@/helpers/SecondaryMenuHelper";
9-
import { useRouter } from "next/navigation";
9+
import { useRouter, usePathname } from "next/navigation";
1010

1111
export function AdminHeader() {
1212
const context = React.useContext(UserContext);
1313
const router = useRouter();
14+
const pathname = usePathname();
1415
const [primaryLabel, setPrimaryLabel] = React.useState<string>("Dashboard");
1516

1617
useEffect(() => {
1718
getPrimaryLabel();
18-
}, [window.location.pathname]);
19+
}, [pathname]);
1920

2021

2122
const getPrimaryMenu = () => {

0 commit comments

Comments
 (0)