Skip to content

Commit 4e03571

Browse files
fix: ccx run order when multiple files are selected
1 parent 18ebd3c commit 4e03571

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/bloc/process_bloc/process_bloc.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,18 @@ class ProcessBloc extends Bloc<ProcessEvent, ProcessState> {
188188
// state.queue automatically.
189189
// if state.started is false, that means that the first x files have
190190
// finsihed processing and then he user adds y new files, so new queue
191-
// need to be set to event.files instead of originalList
191+
// need to be set to event.files instead of originalList.
192+
// state.started can also be false when the users selects x files from
193+
// one folder and then clicks add files again to select y files from
194+
// some different folder, so we should also check if the processed files
195+
// list is empty if no its the above case, if it is empty that means the
196+
// user has selected x and y files from different folders by clicking
197+
// add files button 2 times and we should start running ccx on all the
198+
// files
192199

193200
// TLDR; this part handles the y new files thingy mentioned in
194201
// _extractNext func comments.
195-
queue: state.started
202+
queue: state.started || state.processed.isEmpty
196203
? state.queue.followedBy(event.files).toList()
197204
: event.files,
198205
);

0 commit comments

Comments
 (0)