mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-12-30 20:06:30 +01:00
-
This commit is contained in:
parent
06cdc0d120
commit
9f258894e1
@ -150,8 +150,8 @@ export function fileContextReducer(state: FileContextState, action: FileContextA
|
||||
// Validate that all IDs exist in current state
|
||||
const validIds = orderedFileIds.filter(id => state.files.byId[id]);
|
||||
|
||||
// Reorder selected IDs to match the new order while dropping any that no longer exist
|
||||
const reorderedSelectedIds = validIds.filter(id => state.ui.selectedFileIds.includes(id));
|
||||
// Reorder selected files by passed order
|
||||
const selectedFileIds = orderedFileIds.filter(id => state.ui.selectedFileIds.includes(id));
|
||||
|
||||
return {
|
||||
...state,
|
||||
@ -161,7 +161,7 @@ export function fileContextReducer(state: FileContextState, action: FileContextA
|
||||
},
|
||||
ui: {
|
||||
...state.ui,
|
||||
selectedFileIds: reorderedSelectedIds
|
||||
selectedFileIds,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user