fix master detail and pathname

This commit is contained in:
rizky 2024-04-30 04:38:32 -07:00
parent 291c087812
commit f310cc5a35
2 changed files with 11 additions and 10 deletions

View File

@ -39,18 +39,13 @@ export const MasterDetail: FC<{
on_init, on_init,
}) => { }) => {
let isGenerate = false as Boolean; let isGenerate = false as Boolean;
try{ try {
console.log("MASUK");
isGenerate = false; isGenerate = false;
if (w.generating_prasi_md["master_detail"]){ if (w.generating_prasi_md["master_detail"]) {
isGenerate = true; isGenerate = true;
} }
}catch(ex){ } catch (ex) {}
}
console.log(isGenerate);
if (w.generating_prasi_md && w.generating_prasi_md["xxxx"])
return "generating";
const _ref = useRef({ PassProp, child }); const _ref = useRef({ PassProp, child });
const md = useLocal<MDLocalInternal>({ const md = useLocal<MDLocalInternal>({
name, name,
@ -109,8 +104,7 @@ export const MasterDetail: FC<{
masterDetailInit(md, child, editor_tab); masterDetailInit(md, child, editor_tab);
masterDetailSelected(md); masterDetailSelected(md);
} }
console.log("MASUK?"); if (isGenerate) return <>Generating Master Detail...</>;
if(isGenerate) return <>Generate Master Detail...</>
return ( return (
<div <div
className={cx( className={cx(

View File

@ -19,3 +19,10 @@ export const getPathname = (url?: string) => {
// } // }
return location.pathname; return location.pathname;
}; };
export const getBasename = () => {
if (location.pathname.startsWith("/prod")) {
return location.pathname.split("/").slice(0, 3).join("/");
}
return "";
};