mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-04-16 23:08:38 +02:00
-
This commit is contained in:
@@ -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,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user