@esvndev/es-react-config-setting 1.0.39 → 1.0.40

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.
package/dist/index.js CHANGED
@@ -11484,12 +11484,15 @@ const GetSettingGroup = (callback) => {
11484
11484
  catch (err) {
11485
11485
  console.log('Invalid JSON:', err);
11486
11486
  }
11487
+ callback({ state: true, data: JSON.parse(text) });
11488
+ }
11489
+ else {
11490
+ callback({ state: false, data: text });
11487
11491
  }
11488
- callback({ state: true, data: text });
11489
11492
  })
11490
11493
  .catch(error => {
11491
11494
  console.log('Fetch error:', error);
11492
- callback({ state: true, data: error });
11495
+ callback({ state: false, data: error });
11493
11496
  });
11494
11497
  };
11495
11498
 
@@ -11505,8 +11508,6 @@ const SettingApp = (props) => {
11505
11508
  const [windowSize, setWindowSize] = React.useState(getWindowSize());
11506
11509
  //Cho phép tự đóng hoặc không
11507
11510
  const [backdrop, setBackdrop] = React.useState(true);
11508
- React.useEffect(() => {
11509
- }, []);
11510
11511
  //Sự kiện đóng/mở cài đặt
11511
11512
  const handleModal = () => {
11512
11513
  if (eventClose)
@@ -11530,7 +11531,7 @@ const SettingApp = (props) => {
11530
11531
  GetSettingGroup((data) => {
11531
11532
  setDataSettingGroup(data);
11532
11533
  });
11533
- }, []);
11534
+ }, [isOpen]);
11534
11535
  //Sự kiện chọn nhóm cài đặt
11535
11536
  const switchSettingTab = (data) => {
11536
11537
  const updated = dataSettingGroup.map((item) => ({