Skip to content

Commit

Permalink
fix: use onAnyAction rather than onAction to fix undo/redo bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kswenson committed Oct 24, 2024
1 parent 7675544 commit 859a7f6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions v3/src/models/shared/shared-case-metadata.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { observable } from "mobx"
import { getSnapshot, getType, Instance, ISerializedActionCall, onAction, types } from "mobx-state-tree"
import { onAnyAction } from "../../utilities/mst-utils"
import { CategorySet, createProvisionalCategorySet, ICategorySet } from "../data/category-set"
import { DataSet, IDataSet } from "../data/data-set"
import { ISharedModel, SharedModel } from "./shared-model"
Expand Down Expand Up @@ -121,12 +122,12 @@ export const SharedCaseMetadata = SharedModel
self.removeCategorySet(invalidAttrId)
})
const userActionNames = categorySet.userActionNames
onAction(categorySet, action => {
onAnyAction(categorySet, action => {
// when a category set is changed by the user, it is promoted to a regular CategorySet
if (categorySet && userActionNames.includes(action.name)) {
self.promoteProvisionalCategorySet(categorySet)
}
}, true)
})
}
return categorySet
}
Expand Down

0 comments on commit 859a7f6

Please sign in to comment.