wzyyy пре 3 година
родитељ
комит
dd2001913a
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5 5
      src/pages/link/Type/Detail/index.tsx

+ 5 - 5
src/pages/link/Type/Detail/index.tsx

@@ -57,7 +57,7 @@ const filterConfigByType = (data: any[], type: string) => {
 };
 const Save = observer(() => {
   const param = useParams<{ id: string }>();
-  const location = useLocation();
+  const locations = useLocation();
   const [view, setView] = useState<boolean>(false);
 
   const configRef = useRef([]);
@@ -67,7 +67,7 @@ const Save = observer(() => {
     services(field).then(
       action.bound!((resp: any) => {
         const type = location.href.split('?')?.pop()?.split('=')?.pop() || '';
-        const save = location?.href?.split('/');
+        const save = location?.href?.split?.('/');
         if (location.href.includes('type=') && !!type) {
           field.value = type;
         } else if (save[save.length - 1] === ':id') {
@@ -1002,10 +1002,10 @@ const Save = observer(() => {
 
   const { getOtherPermission } = usePermissions('link/Type');
   useEffect(() => {
-    if (location && location.state) {
-      setView(location.state.view);
+    if (locations && locations.state) {
+      setView(locations.state.view);
     }
-  }, [location]);
+  }, [locations]);
   return (
     <PageContainer>
       <Card>