Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
mvasilak committed Jan 13, 2025
1 parent 1393c2b commit 18a6a8c
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,8 @@ struct ItemDetailActionHandler: ViewModelActionHandler, BackgroundDbProcessingAc
) {
update(viewModel: viewModel) { state in
state.data = data
if state.snapshot != nil || isEditing {
state.snapshot = data
}
if isEditing {
state.snapshot = data
// During editing show only editable fields or non-empty, non-editable ones.
state.visibleFieldIds = ItemDetailDataCreator.editableOrNonEmptyFieldKeys(from: data.fields)
} else {
Expand Down

0 comments on commit 18a6a8c

Please sign in to comment.