@ledvance/ui-biz-bundle 1.1.85 → 1.1.87
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/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
View,
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import { Utils } from 'tuya-panel-kit';
|
|
12
|
-
import { useReactive } from 'ahooks';
|
|
12
|
+
import { useReactive, useUpdateEffect } from 'ahooks';
|
|
13
13
|
import { cloneDeep, isEqual } from 'lodash';
|
|
14
14
|
import Page from '@ledvance/base/src/components/Page';
|
|
15
15
|
import Strings from '@ledvance/base/src/i18n';
|
|
@@ -122,6 +122,18 @@ const MixDynamicMoodEditorPage = () => {
|
|
|
122
122
|
return currentOther.label;
|
|
123
123
|
}, []);
|
|
124
124
|
|
|
125
|
+
useUpdateEffect(() =>{
|
|
126
|
+
if (state.mainNodeIdx < state.mood.mainLamp.nodes?.length){
|
|
127
|
+
state.mainNode = state.mood.mainLamp.nodes[state.mainNodeIdx]
|
|
128
|
+
}
|
|
129
|
+
}, [JSON.stringify(state.mood.mainLamp.nodes), state.mainNodeIdx])
|
|
130
|
+
|
|
131
|
+
useUpdateEffect(() =>{
|
|
132
|
+
if (state.secondaryIdx < state.mood.secondaryLamp.nodes?.length ){
|
|
133
|
+
state.secondaryNode = state.mood.secondaryLamp.nodes[state.secondaryIdx]
|
|
134
|
+
}
|
|
135
|
+
}, [JSON.stringify(state.mood.secondaryLamp.nodes), state.secondaryIdx])
|
|
136
|
+
|
|
125
137
|
const nameRepeat = useMemo(() => {
|
|
126
138
|
return params.nameRepeat(state.mood)
|
|
127
139
|
}, [state.mood.name]);
|
|
@@ -61,16 +61,16 @@ const MoodPage = () => {
|
|
|
61
61
|
const secondaryIds = map(state.originMoods.map(m => m.secondaryLamp) || [], 'id')
|
|
62
62
|
return filter([...mainIds, ...secondaryIds], v => v !== undefined) as number[]
|
|
63
63
|
}, [JSON.stringify(state.originMoods)])
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
useEffect(() => {
|
|
66
|
-
state.loading = true
|
|
66
|
+
state.loading = true
|
|
67
67
|
state.timerId = setTimeout(() => {
|
|
68
68
|
getRemoteMoodList(
|
|
69
69
|
devId,
|
|
70
70
|
params,
|
|
71
71
|
params.featureId
|
|
72
72
|
).then(res => {
|
|
73
|
-
state.loading = false
|
|
73
|
+
state.loading = false
|
|
74
74
|
if (res.success && Array.isArray(res.data)) {
|
|
75
75
|
state.originMoods = cloneDeep(res.data);
|
|
76
76
|
}
|
|
@@ -403,6 +403,7 @@ const styles = StyleSheet.create({
|
|
|
403
403
|
popoverItem: {
|
|
404
404
|
padding: cx(5),
|
|
405
405
|
alignItems: 'flex-start',
|
|
406
|
+
alignSelf: 'flex-start'
|
|
406
407
|
},
|
|
407
408
|
});
|
|
408
409
|
|