mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +01:00
Fix runtime type error
This commit is contained in:
parent
7dde4b1de9
commit
bfbfaffe5c
2 changed files with 4 additions and 5 deletions
|
@ -205,7 +205,7 @@ class CollectionItemsController {
|
||||||
?.run((e) => _dataStreamController.addError(e.error, e.stackTrace));
|
?.run((e) => _dataStreamController.addError(e.error, e.stackTrace));
|
||||||
if (failed.isNotEmpty) {
|
if (failed.isNotEmpty) {
|
||||||
_dataStreamController.addWithValue((value) => value.copyWith(
|
_dataStreamController.addWithValue((value) => value.copyWith(
|
||||||
items: value.items + failed,
|
items: [...value.items, ...failed],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
} else if (isInited != _isDataStreamInited) {
|
} else if (isInited != _isDataStreamInited) {
|
||||||
|
@ -265,7 +265,7 @@ class CollectionItemsController {
|
||||||
?.run((e) => _dataStreamController.addError(e.error, e.stackTrace));
|
?.run((e) => _dataStreamController.addError(e.error, e.stackTrace));
|
||||||
if (failed.isNotEmpty) {
|
if (failed.isNotEmpty) {
|
||||||
_dataStreamController.addWithValue((value) => value.copyWith(
|
_dataStreamController.addWithValue((value) => value.copyWith(
|
||||||
items: value.items + failed,
|
items: [...value.items, ...failed],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
} else if (isInited != _isDataStreamInited) {
|
} else if (isInited != _isDataStreamInited) {
|
||||||
|
|
|
@ -4,7 +4,6 @@ import 'package:nc_photos/account.dart';
|
||||||
import 'package:nc_photos/debug_util.dart';
|
import 'package:nc_photos/debug_util.dart';
|
||||||
import 'package:nc_photos/di_container.dart';
|
import 'package:nc_photos/di_container.dart';
|
||||||
import 'package:nc_photos/entity/collection_item.dart';
|
import 'package:nc_photos/entity/collection_item.dart';
|
||||||
import 'package:nc_photos/entity/collection_item/basic_item.dart';
|
|
||||||
import 'package:nc_photos/entity/file_descriptor.dart';
|
import 'package:nc_photos/entity/file_descriptor.dart';
|
||||||
import 'package:nc_photos/entity/nc_album.dart';
|
import 'package:nc_photos/entity/nc_album.dart';
|
||||||
import 'package:nc_photos/use_case/remove.dart';
|
import 'package:nc_photos/use_case/remove.dart';
|
||||||
|
@ -29,7 +28,7 @@ class RemoveFromNcAlbum {
|
||||||
"[call] Remove ${items.length} items from album '${album.strippedPath}'");
|
"[call] Remove ${items.length} items from album '${album.strippedPath}'");
|
||||||
final fileItems = items
|
final fileItems = items
|
||||||
.whereIndexed((i, e) {
|
.whereIndexed((i, e) {
|
||||||
if (e is! BasicCollectionFileItem) {
|
if (e is! CollectionFileItem) {
|
||||||
onError?.call(
|
onError?.call(
|
||||||
i,
|
i,
|
||||||
e,
|
e,
|
||||||
|
@ -41,7 +40,7 @@ class RemoveFromNcAlbum {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.cast<BasicCollectionFileItem>()
|
.cast<CollectionFileItem>()
|
||||||
.toList();
|
.toList();
|
||||||
var count = fileItems.length;
|
var count = fileItems.length;
|
||||||
await Remove(_c)(
|
await Remove(_c)(
|
||||||
|
|
Loading…
Reference in a new issue