fix master detail and pathname
This commit is contained in:
parent
291c087812
commit
f310cc5a35
|
|
@ -40,17 +40,12 @@ export const MasterDetail: FC<{
|
||||||
}) => {
|
}) => {
|
||||||
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(
|
||||||
|
|
|
||||||
|
|
@ -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 "";
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue