@zat-design/sisyphus-react 3.13.16-beta.4 → 3.13.16-beta.5
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.
@@ -83,11 +83,9 @@ export var ProConfigProvider = function ProConfigProvider(props) {
|
|
83
83
|
var cacheLang = localStorage.getItem('locale');
|
84
84
|
// 如果是用户切换了语言那么优先使用用户切换的,否则从缓存中取用户语言,在取默认值
|
85
85
|
var lang = (state === null || state === void 0 ? void 0 : state.locale) || cacheLang || (props === null || props === void 0 ? void 0 : props.locale);
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
setLanguage(props === null || props === void 0 ? void 0 : props.locale);
|
90
|
-
}
|
86
|
+
useEffect(function () {
|
87
|
+
if (lang) setLanguage(lang);
|
88
|
+
}, [lang]);
|
91
89
|
useEffect(function () {
|
92
90
|
if (enumRes === null || enumRes === void 0 ? void 0 : enumRes.data) {
|
93
91
|
(props === null || props === void 0 ? void 0 : props.onSuccess) && (props === null || props === void 0 ? void 0 : props.onSuccess(enumRes === null || enumRes === void 0 ? void 0 : enumRes.data, enumRes === null || enumRes === void 0 ? void 0 : enumRes.params));
|
@@ -92,11 +92,9 @@ var ProConfigProvider = exports.ProConfigProvider = function ProConfigProvider(p
|
|
92
92
|
var cacheLang = localStorage.getItem('locale');
|
93
93
|
// 如果是用户切换了语言那么优先使用用户切换的,否则从缓存中取用户语言,在取默认值
|
94
94
|
var lang = (state === null || state === void 0 ? void 0 : state.locale) || cacheLang || (props === null || props === void 0 ? void 0 : props.locale);
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
(0, _locale.setLanguage)(props === null || props === void 0 ? void 0 : props.locale);
|
99
|
-
}
|
95
|
+
(0, _react.useEffect)(function () {
|
96
|
+
if (lang) (0, _locale.setLanguage)(lang);
|
97
|
+
}, [lang]);
|
100
98
|
(0, _react.useEffect)(function () {
|
101
99
|
if (enumRes === null || enumRes === void 0 ? void 0 : enumRes.data) {
|
102
100
|
(props === null || props === void 0 ? void 0 : props.onSuccess) && (props === null || props === void 0 ? void 0 : props.onSuccess(enumRes === null || enumRes === void 0 ? void 0 : enumRes.data, enumRes === null || enumRes === void 0 ? void 0 : enumRes.params));
|