mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-08 18:28:53 +01:00
Fix nc album files being removed in collection items controller
This commit is contained in:
parent
e169a5b56c
commit
aa2f11ef3e
1 changed files with 8 additions and 2 deletions
|
@ -14,6 +14,7 @@ import 'package:nc_photos/entity/collection/adapter.dart';
|
||||||
import 'package:nc_photos/entity/collection_item.dart';
|
import 'package:nc_photos/entity/collection_item.dart';
|
||||||
import 'package:nc_photos/entity/collection_item/new_item.dart';
|
import 'package:nc_photos/entity/collection_item/new_item.dart';
|
||||||
import 'package:nc_photos/entity/file_descriptor.dart';
|
import 'package:nc_photos/entity/file_descriptor.dart';
|
||||||
|
import 'package:nc_photos/entity/file_util.dart' as file_util;
|
||||||
import 'package:nc_photos/exception_event.dart';
|
import 'package:nc_photos/exception_event.dart';
|
||||||
import 'package:nc_photos/object_extension.dart';
|
import 'package:nc_photos/object_extension.dart';
|
||||||
import 'package:nc_photos/rx_extension.dart';
|
import 'package:nc_photos/rx_extension.dart';
|
||||||
|
@ -366,8 +367,13 @@ class CollectionItemsController {
|
||||||
if (e is CollectionFileItem) {
|
if (e is CollectionFileItem) {
|
||||||
final file = ev.dataMap[e.file.fdId];
|
final file = ev.dataMap[e.file.fdId];
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
// removed
|
if (file_util.isNcAlbumFile(account, e.file)) {
|
||||||
return null;
|
// file shared with us are not in our db
|
||||||
|
return e;
|
||||||
|
} else {
|
||||||
|
// removed
|
||||||
|
return null;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return e.copyWith(file: file);
|
return e.copyWith(file: file);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue