@visns-studio/visns-components 2.0.9 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,23 +27,7 @@ function GenericDetail({ setting, urlParam, userProfile }) {
27
27
  const [config, setConfig] = useState({});
28
28
  const [data, setData] = useState({});
29
29
  const [dataReload, setDataReload] = useState(0);
30
- const [subnav, setSubnav] = useState(() => {
31
- return filters.map((f) => {
32
- if (
33
- f.hasOwnProperty('url') &&
34
- f.baseUrl &&
35
- f.urlParam &&
36
- routeParams[f.urlParam]
37
- ) {
38
- return {
39
- ...f,
40
- url: `${f.baseUrl}${routeParams[f.urlParam]}`,
41
- };
42
- } else {
43
- return f;
44
- }
45
- });
46
- });
30
+ const [subnav, setSubnav] = useState([]);
47
31
 
48
32
  const [total, setTotal] = useState(0);
49
33
 
@@ -483,6 +467,26 @@ function GenericDetail({ setting, urlParam, userProfile }) {
483
467
  }
484
468
  }, [routeParams, dataReload]);
485
469
 
470
+ useEffect(() => {
471
+ setSubnav(() => {
472
+ return filters.map((f) => {
473
+ if (
474
+ f.hasOwnProperty('url') &&
475
+ f.baseUrl &&
476
+ f.urlParam &&
477
+ routeParams[f.urlParam]
478
+ ) {
479
+ return {
480
+ ...f,
481
+ url: `${f.baseUrl}${routeParams[f.urlParam]}`,
482
+ };
483
+ } else {
484
+ return f;
485
+ }
486
+ });
487
+ });
488
+ }, [filters]);
489
+
486
490
  /** Modal States */
487
491
  const [formData, setFormData] = useState({});
488
492
  const [formType, setFormType] = useState('');
package/package.json CHANGED
@@ -40,7 +40,7 @@
40
40
  "react-dom": "^17.0.1"
41
41
  },
42
42
  "name": "@visns-studio/visns-components",
43
- "version": "2.0.9",
43
+ "version": "2.0.10",
44
44
  "description": "Various packages to assist in the development of our Custom Applications.",
45
45
  "main": "index.js",
46
46
  "scripts": {