@ledvance/group-ui-biz-bundle 1.0.93 → 1.0.94
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
|
@@ -2,7 +2,7 @@ import React, {useCallback, useEffect, useMemo} from 'react';
|
|
|
2
2
|
import Page from '@ledvance/base/src/components/Page';
|
|
3
3
|
import {Utils} from 'tuya-panel-kit';
|
|
4
4
|
import {useDeviceInfo} from '@ledvance/base/src/models/modules/NativePropsSlice';
|
|
5
|
-
import {useReactive} from 'ahooks';
|
|
5
|
+
import {useReactive, useUpdateEffect} from 'ahooks';
|
|
6
6
|
import I18n from '@ledvance/base/src/i18n';
|
|
7
7
|
import res from '@ledvance/base/src/res';
|
|
8
8
|
import {FlatList, Image, Platform, StyleSheet, TouchableOpacity, View} from 'react-native';
|
|
@@ -111,6 +111,10 @@ const DiyScenePage = (props: { theme?: ThemeType }) => {
|
|
|
111
111
|
[workMode, switchLed, sceneStatusId]
|
|
112
112
|
);
|
|
113
113
|
|
|
114
|
+
useUpdateEffect(() => {
|
|
115
|
+
state.originScenes = cloneDeep(scenes) as DiySceneInfo[];
|
|
116
|
+
}, [scenes]);
|
|
117
|
+
|
|
114
118
|
const nameRepeat = useCallback((scene: DiySceneInfo) => {
|
|
115
119
|
return !!state.originScenes.filter(m => m.id !== scene.id).find(m => m.name === scene.name)
|
|
116
120
|
}, [state.originScenes])
|
|
@@ -231,7 +235,7 @@ const DiyScenePage = (props: { theme?: ThemeType }) => {
|
|
|
231
235
|
subTitle: I18n.getLang('reset_mooddescription'),
|
|
232
236
|
onConfirm: async (_, { close }) => {
|
|
233
237
|
close()
|
|
234
|
-
resetMixScenes()
|
|
238
|
+
resetMixScenes().then();
|
|
235
239
|
}
|
|
236
240
|
})
|
|
237
241
|
}}
|