mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: build error for 404 and search params null check (#1919)
This commit is contained in:
parent
0bccb63a9f
commit
41e55dff85
@ -25,7 +25,8 @@ const WorkspaceProjectPage = observer(() => {
|
|||||||
const routerSearchparams = useSearchParams();
|
const routerSearchparams = useSearchParams();
|
||||||
|
|
||||||
const { workspace_slug, project_slug } = routerParams as { workspace_slug: string; project_slug: string };
|
const { workspace_slug, project_slug } = routerParams as { workspace_slug: string; project_slug: string };
|
||||||
const board = routerSearchparams.get("board") as TIssueBoardKeys | "";
|
const board =
|
||||||
|
routerSearchparams && routerSearchparams.get("board") != null && (routerSearchparams.get("board") as TIssueBoardKeys | "");
|
||||||
|
|
||||||
// updating default board view when we are in the issues page
|
// updating default board view when we are in the issues page
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
// next imports
|
|
||||||
import { useSearchParams } from "next/navigation";
|
|
||||||
// interface
|
|
||||||
import { TIssueBoardKeys } from "store/types";
|
|
||||||
// mobx store
|
// mobx store
|
||||||
import { useMobxStore } from "lib/mobx/store-provider";
|
import { useMobxStore } from "lib/mobx/store-provider";
|
||||||
import { RootStore } from "store/root";
|
import { RootStore } from "store/root";
|
||||||
@ -12,11 +8,6 @@ import { RootStore } from "store/root";
|
|||||||
const MobxStoreInit = () => {
|
const MobxStoreInit = () => {
|
||||||
const store: RootStore = useMobxStore();
|
const store: RootStore = useMobxStore();
|
||||||
|
|
||||||
// search params
|
|
||||||
const routerSearchparams = useSearchParams();
|
|
||||||
|
|
||||||
const board = routerSearchparams.get("board") as TIssueBoardKeys;
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// theme
|
// theme
|
||||||
const _theme = localStorage && localStorage.getItem("app_theme") ? localStorage.getItem("app_theme") : "light";
|
const _theme = localStorage && localStorage.getItem("app_theme") ? localStorage.getItem("app_theme") : "light";
|
||||||
|
10
apps/space/pages/_app.tsx
Normal file
10
apps/space/pages/_app.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// styles
|
||||||
|
import "styles/globals.css";
|
||||||
|
// types
|
||||||
|
import type { AppProps } from "next/app";
|
||||||
|
|
||||||
|
function MyApp({ Component, pageProps }: AppProps) {
|
||||||
|
return <Component {...pageProps} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default MyApp;
|
17
apps/space/pages/_document.tsx
Normal file
17
apps/space/pages/_document.tsx
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import Document, { Html, Head, Main, NextScript } from "next/document";
|
||||||
|
|
||||||
|
class MyDocument extends Document {
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<Html>
|
||||||
|
<Head />
|
||||||
|
<body>
|
||||||
|
<Main />
|
||||||
|
<NextScript />
|
||||||
|
</body>
|
||||||
|
</Html>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default MyDocument;
|
Loading…
Reference in New Issue
Block a user