Skip to content

Commit e958108

Browse files
authored
Preserve id when syncing model groups. (#164)
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
1 parent 3f13a12 commit e958108

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/redux/slices/Model.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ const reducers = {
134134
const definitions = state.parameterDefinitions;
135135
currentGroup.modelName = modelName;
136136
if (originalGroup) {
137+
currentGroup.id = currentGroup.id ?? originalGroup.id;
137138
currentGroup.name = currentGroup.name !== '' ? currentGroup.name : originalGroup.name;
138139
currentGroup.type = currentGroup.type !== '' ? currentGroup.type : originalGroup.type;
139140
} else if (isAbsolute) {
@@ -230,6 +231,7 @@ const extraReducers = (builder) => {
230231
const updatedModel = state.models.find((model) => model.name === updatedGroup.modelName);
231232
if (updatedModel) {
232233
const simpleUpdatedGroup = {
234+
id: updatedGroup.id,
233235
name: updatedGroup.name,
234236
type: updatedGroup.type,
235237
setsNumber: updatedGroup.sets.length,

0 commit comments

Comments
 (0)