-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
src/store/effects/add-multiple-files.ts:4-8 loads files one by one in a for loop:
const addMultipleFiles = createAsyncThunk("addMultipleFiles", async (paths: string[], thunkAPI) => {
for (const path of paths) {
thunkAPI.dispatch(addFile(path))
}
})When dragging multiple files onto the app, each file waits for the previous one to finish. This creates a poor user experience with large file sets.
What needs to change
Dispatch all addFile thunks in parallel using Promise.all:
const addMultipleFiles = createAsyncThunk("addMultipleFiles", async (paths: string[], thunkAPI) => {
await Promise.all(paths.map(path => thunkAPI.dispatch(addFile(path))))
})Note: verify that SourceStorage on the Rust side handles concurrent access safely (it uses Mutex, so should be fine).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request