@ledvance/base 1.2.42 → 1.2.43

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
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.2.42",
7
+ "version": "1.2.43",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
@@ -58,13 +58,14 @@ export const addListener = (store) => {
58
58
  })
59
59
 
60
60
  groupFeatureListener = nativeEventEmitter.addListener('UAGroupFeatureUpdate', (event: GroupFeatureEvent) => {
61
- if (event.tyGroupId == store.getState().ldvModules.uaGroupInfo.tyGroupId) {
61
+ const tyGroupId = Number(event.tyGroupId)
62
+ if (tyGroupId === store.getState().ldvModules.uaGroupInfo.tyGroupId) {
62
63
  console.log('长链接刷新Group数据', event)
63
64
  const nativeProps: NativeProps = {
64
65
  familyName: '',
65
66
  deviceInfo: {} as DeviceInfo,
66
67
  uaGroupInfo: {
67
- tyGroupId: event.tyGroupId,
68
+ tyGroupId: tyGroupId,
68
69
  pId: '',
69
70
  config: JSON.parse(event.config),
70
71
  dps: {},
@@ -101,7 +101,7 @@ const nativePropsSlice = createSlice({
101
101
  state.uaGroupInfo.config = action.payload.uaGroupInfo.config
102
102
  },
103
103
  setGroupConfig: (state, action: PayloadAction<any>) => {
104
- state.uaGroupInfo.config = action.payload
104
+ state.uaGroupInfo.config = { ...state.uaGroupInfo.config, ...action.payload }
105
105
  },
106
106
  setDps(state, action: PayloadAction<any>) {
107
107
  const dpKeys = Object.keys(action.payload)
@@ -299,7 +299,7 @@ export function useGroupConfig<T>(): [T, (dps: any, newConfig: T) => Promise<Res
299
299
  const res = await NativeApi.groupControl(tyGroupId, JSON.stringify(dps), JSON.stringify(newConfig))
300
300
  if (res.success) {
301
301
  // 只在结果成功时才改变 redux 数据
302
- dispatch(setGroupConfig({...config, ...newConfig}))
302
+ dispatch(setGroupConfig(newConfig))
303
303
  }
304
304
  return res
305
305
  }, [])