@esvndev/es-react-config-setting 1.0.70 → 1.0.72
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/components/init/index.d.ts +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { key_format } from "../../shared/type";
|
|
2
2
|
export declare const GLOBAL_WINDOW_VARIABLE: Record<string, any>;
|
|
3
3
|
export declare const INIT_CONFIG_SETTING: () => void;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const get_conf: (key: string, type?: key_format) => any;
|
package/dist/index.js
CHANGED
|
@@ -19023,6 +19023,7 @@ const SettingApp = (props) => {
|
|
|
19023
19023
|
|
|
19024
19024
|
const GLOBAL_WINDOW_VARIABLE = {};
|
|
19025
19025
|
let intervalId = null;
|
|
19026
|
+
var TIME_RELOAD = 15000;
|
|
19026
19027
|
//Load interval data default
|
|
19027
19028
|
const INIT_CONFIG_SETTING = () => {
|
|
19028
19029
|
_LOAD_(null);
|
|
@@ -19032,13 +19033,16 @@ const INIT_CONFIG_SETTING = () => {
|
|
|
19032
19033
|
}
|
|
19033
19034
|
intervalId = setInterval(() => {
|
|
19034
19035
|
_FETCH_AND_UPDATE();
|
|
19035
|
-
},
|
|
19036
|
+
}, TIME_RELOAD);
|
|
19036
19037
|
};
|
|
19037
19038
|
const _FETCH_AND_UPDATE = () => {
|
|
19038
19039
|
GetSettingConfigClient((data) => {
|
|
19039
19040
|
try {
|
|
19041
|
+
if (data?.isupdatetime) {
|
|
19042
|
+
TIME_RELOAD = (data?.timeupdate < 5000 || data?.timeupdate > 300000) ? 5000 : data?.timeupdate;
|
|
19043
|
+
}
|
|
19040
19044
|
if (data?.status && data?.isupdate && data?.data) {
|
|
19041
|
-
localStorage.setItem("
|
|
19045
|
+
localStorage.setItem("app_config_setting", JSON.stringify(data.data));
|
|
19042
19046
|
localStorage.setItem("app_config_setting_version", data.version);
|
|
19043
19047
|
_LOAD_(data.data);
|
|
19044
19048
|
}
|
|
@@ -19052,7 +19056,7 @@ const _FETCH_AND_UPDATE = () => {
|
|
|
19052
19056
|
const _LOAD_ = (data) => {
|
|
19053
19057
|
let _ = {};
|
|
19054
19058
|
if (!data) {
|
|
19055
|
-
const _json = localStorage.getItem("
|
|
19059
|
+
const _json = localStorage.getItem("app_config_setting");
|
|
19056
19060
|
try {
|
|
19057
19061
|
_ = JSON.parse(_json ?? '{}');
|
|
19058
19062
|
}
|