aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/ducks/utils/view.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/js/ducks/utils/view.js')
-rw-r--r--web/src/js/ducks/utils/view.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/src/js/ducks/utils/view.js b/web/src/js/ducks/utils/view.js
index 5535ed83..ff6f4c12 100644
--- a/web/src/js/ducks/utils/view.js
+++ b/web/src/js/ducks/utils/view.js
@@ -96,10 +96,12 @@ export function updateViewList(currentView, currentList, nextList, action, filte
return sortedInsert(currentView, sortFn, action.item)
if (isInView && !shouldBeInView)
return sortedRemove(currentView, sortFn, action.item)
- if (isInView && shouldBeInView && sortFn && sortFn(currentItemState) !== sortFn(nextItemState)) {
+ if (isInView && shouldBeInView) {
let s = [...currentView]
- s.sort(makeCompareFn(sortFn))
s.indexOf = x => sortedIndexOf(s, x, sortFn)
+ s[s.indexOf(currentItemState)] = nextItemState
+ if (sortFn && sortFn(currentItemState) !== sortFn(nextItemState))
+ s.sort(makeCompareFn(sortFn))
return s
}
return currentView