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

@ -40,17 +40,12 @@ export const MasterDetail: FC<{
}) => {
let isGenerate = false as Boolean;
try {
console.log("MASUK");
isGenerate = false;
if (w.generating_prasi_md["master_detail"]) {
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 md = useLocal<MDLocalInternal>({
name,
@ -109,8 +104,7 @@ export const MasterDetail: FC<{
masterDetailInit(md, child, editor_tab);
masterDetailSelected(md);
}
console.log("MASUK?");
if(isGenerate) return <>Generate Master Detail...</>
if (isGenerate) return <>Generating Master Detail...</>;
return (
<div
className={cx(

View File

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