Skip to content

Commit

Permalink
Update drive_detail_cubit.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocarvalhodev committed Oct 29, 2024
1 parent 65bac90 commit ce762d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/blocs/drive_detail/drive_detail_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
final DriveRepository _driveRepository;

StreamSubscription? _folderSubscription;
StreamController<void>? _folderSubscriptionController;
final _defaultAvailableRowsPerPage = [25, 50, 75, 100];

List<ArDriveDataTableItem> _selectedItems = [];
Expand Down Expand Up @@ -107,6 +108,8 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
return;
}

await _folderSubscription?.cancel();

_driveId = driveId;

openFolder(folderId: drive.rootFolderId);
Expand Down Expand Up @@ -147,6 +150,8 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
}

if (driveId != _driveId) {
await _folderSubscription?.cancel();
_folderSubscription = null;
return;
}

Expand Down

0 comments on commit ce762d5

Please sign in to comment.