@ledvance/ui-biz-bundle 1.1.26 → 1.1.27
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
|
@@ -216,7 +216,7 @@ const FlagPage = () => {
|
|
|
216
216
|
<FlatList
|
|
217
217
|
data={state.flags}
|
|
218
218
|
renderItem={({ item }) => <FlagItem
|
|
219
|
-
enable={flagMode && dps[params.workModeCode] === (params.isStripLight ? WORK_MODE.COLOUR : WORK_MODE.SCENE) && flagId === item.id}
|
|
219
|
+
enable={flagMode?.flagMode && dps[params.workModeCode] === (params.isStripLight ? WORK_MODE.COLOUR : WORK_MODE.SCENE) && flagId === item.id}
|
|
220
220
|
title={item.name}
|
|
221
221
|
icon={item.icon}
|
|
222
222
|
colors={item.colors.map(item => hsv2Hex(item.h, item.s, item.v))}
|
|
@@ -3,7 +3,7 @@ import Page from '@ledvance/base/src/components/Page'
|
|
|
3
3
|
import { Utils } from 'tuya-panel-kit'
|
|
4
4
|
import { StripScenePageUIState, StripSceneUIState } from '../scene/SceneInfo'
|
|
5
5
|
import { getRemoteFantasyScene, useFantasyScene } from '../scene/SceneAction'
|
|
6
|
-
import { useDeviceInfo } from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
6
|
+
import { useDeviceInfo, useFlagMode } from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
7
7
|
import { useReactive } from 'ahooks'
|
|
8
8
|
import Strings from '@ledvance/base/src/i18n'
|
|
9
9
|
import res from '@ledvance/base/src/res'
|
|
@@ -13,6 +13,7 @@ import FantasyMoodItem from './FantasyMoodItem'
|
|
|
13
13
|
import { useNavigation, useRoute } from '@react-navigation/core'
|
|
14
14
|
import { ui_biz_routerKey } from '../../navigation/Routers'
|
|
15
15
|
import { SCENE, useWorkMode } from 'hooks/DeviceDpStateHooks'
|
|
16
|
+
import { saveFlagMode } from '../flags/FlagActions'
|
|
16
17
|
const cx = Utils.RatioUtils.convertX
|
|
17
18
|
|
|
18
19
|
interface MoodPageUIState extends StripScenePageUIState {
|
|
@@ -43,6 +44,7 @@ const FantasyMoodPage = () => {
|
|
|
43
44
|
}
|
|
44
45
|
const [sceneId, setScene] = useFantasyScene(params.sceneDpCode, params.workModeDpCode, params.switchLedDpCode, params.isStringLight)
|
|
45
46
|
const [workMode] = useWorkMode(params.workModeDpCode)
|
|
47
|
+
const [flagMode, setFlagMode] = useFlagMode()
|
|
46
48
|
const deviceInfo = useDeviceInfo()
|
|
47
49
|
const navigation = useNavigation()
|
|
48
50
|
|
|
@@ -86,6 +88,19 @@ const FantasyMoodPage = () => {
|
|
|
86
88
|
return state.currentScene?.id === id && workMode === SCENE
|
|
87
89
|
}, [state.currentScene?.id, workMode])
|
|
88
90
|
|
|
91
|
+
const updateFlagMode = () =>{
|
|
92
|
+
if(flagMode && params.isSupportColor){
|
|
93
|
+
saveFlagMode(deviceInfo.devId, JSON.stringify({
|
|
94
|
+
flagMode: false,
|
|
95
|
+
flagId: undefined
|
|
96
|
+
})).then()
|
|
97
|
+
setFlagMode({
|
|
98
|
+
flagMode: false,
|
|
99
|
+
flagId: undefined
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
89
104
|
return (
|
|
90
105
|
<>
|
|
91
106
|
<Page
|
|
@@ -111,6 +126,7 @@ const FantasyMoodPage = () => {
|
|
|
111
126
|
if (getSwitchEnable(item.id)) return
|
|
112
127
|
state.loading = true
|
|
113
128
|
await setScene(item)
|
|
129
|
+
updateFlagMode()
|
|
114
130
|
state.loading = false
|
|
115
131
|
}} />
|
|
116
132
|
)
|