From f310cc5a35e694efa97375819e483187cc084c7b Mon Sep 17 00:00:00 2001 From: rizky Date: Tue, 30 Apr 2024 04:38:32 -0700 Subject: [PATCH] fix master detail and pathname --- comps/md/MasterDetail.tsx | 14 ++++---------- utils/pathname.ts | 7 +++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/comps/md/MasterDetail.tsx b/comps/md/MasterDetail.tsx index cce6468..3bded10 100755 --- a/comps/md/MasterDetail.tsx +++ b/comps/md/MasterDetail.tsx @@ -39,18 +39,13 @@ export const MasterDetail: FC<{ on_init, }) => { let isGenerate = false as Boolean; - try{ - console.log("MASUK"); + try { isGenerate = false; - if (w.generating_prasi_md["master_detail"]){ + 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({ 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 (
{ // } return location.pathname; }; + +export const getBasename = () => { + if (location.pathname.startsWith("/prod")) { + return location.pathname.split("/").slice(0, 3).join("/"); + } + return ""; +};