Skip to content
Snippets Groups Projects

Ui refactor style

Merged Matthias Feyll requested to merge ui-refactor-style into ui-integration
8 files
+ 142
35
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -45,13 +45,27 @@ const deviceSlice = createSlice({
setActiveTab: (state, action: PayloadAction<DeviceViewTabValues>) => {
state.activeTab = action.payload
},
setSelectedDevice: (state, action: PayloadAction<Device | null>) => {
let selectedObject = null;
if (action.payload) {
selectedObject = { device: action.payload, mne: null, json: null }
}
setSelectedDevice: {
reducer: (state, action: PayloadAction<Device | null, string, { skipListener?: boolean }>) => {
// do thing if desired device is already selected
if (state.selected?.device.id === action.payload?.id) {
action.meta.skipListener = true
return
}
let selectedObject = null;
if (action.payload) {
selectedObject = { device: action.payload, mne: null, json: null }
}
state.selected = selectedObject
state.selected = selectedObject
},
prepare: (device: Device | null) => {
return {
payload: device,
meta: { skipListener: false } // set to true when needed
}
}
},
setSelectedMne: (state, action: PayloadAction<NetworkelementManagedNetworkElement>) => {
if (!state.selected) {
Loading