|
@@ -15,7 +15,6 @@ import 'package:photos/models/files_split.dart';
|
|
import 'package:photos/models/gallery_type.dart';
|
|
import 'package:photos/models/gallery_type.dart';
|
|
import "package:photos/models/metadata/common_keys.dart";
|
|
import "package:photos/models/metadata/common_keys.dart";
|
|
import 'package:photos/models/selected_files.dart';
|
|
import 'package:photos/models/selected_files.dart';
|
|
-import "package:photos/service_locator.dart";
|
|
|
|
import 'package:photos/services/collections_service.dart';
|
|
import 'package:photos/services/collections_service.dart';
|
|
import 'package:photos/services/hidden_service.dart';
|
|
import 'package:photos/services/hidden_service.dart';
|
|
import "package:photos/theme/colors.dart";
|
|
import "package:photos/theme/colors.dart";
|
|
@@ -64,7 +63,6 @@ class _FileSelectionActionsWidgetState
|
|
late FilesSplit split;
|
|
late FilesSplit split;
|
|
late CollectionActions collectionActions;
|
|
late CollectionActions collectionActions;
|
|
late bool isCollectionOwner;
|
|
late bool isCollectionOwner;
|
|
- bool _isInternalUser = false;
|
|
|
|
|
|
|
|
// _cachedCollectionForSharedLink is primarily used to avoid creating duplicate
|
|
// _cachedCollectionForSharedLink is primarily used to avoid creating duplicate
|
|
// links if user keeps on creating Create link button after selecting
|
|
// links if user keeps on creating Create link button after selecting
|
|
@@ -102,7 +100,6 @@ class _FileSelectionActionsWidgetState
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
- _isInternalUser = flagService.internalUser;
|
|
|
|
final ownedFilesCount = split.ownedByCurrentUser.length;
|
|
final ownedFilesCount = split.ownedByCurrentUser.length;
|
|
final ownedAndPendingUploadFilesCount =
|
|
final ownedAndPendingUploadFilesCount =
|
|
ownedFilesCount + split.pendingUploads.length;
|
|
ownedFilesCount + split.pendingUploads.length;
|
|
@@ -150,14 +147,13 @@ class _FileSelectionActionsWidgetState
|
|
|
|
|
|
final showUploadIcon = widget.type == GalleryType.localFolder &&
|
|
final showUploadIcon = widget.type == GalleryType.localFolder &&
|
|
split.ownedByCurrentUser.isEmpty;
|
|
split.ownedByCurrentUser.isEmpty;
|
|
- if (widget.type.showAddToAlbum() ||
|
|
|
|
- (_isInternalUser && widget.type == GalleryType.sharedCollection)) {
|
|
|
|
|
|
+ if (widget.type.showAddToAlbum()) {
|
|
if (showUploadIcon) {
|
|
if (showUploadIcon) {
|
|
items.add(
|
|
items.add(
|
|
SelectionActionButton(
|
|
SelectionActionButton(
|
|
icon: Icons.cloud_upload_outlined,
|
|
icon: Icons.cloud_upload_outlined,
|
|
labelText: S.of(context).addToEnte,
|
|
labelText: S.of(context).addToEnte,
|
|
- onTap: (anyOwnedFiles || _isInternalUser) ? _addToAlbum : null,
|
|
|
|
|
|
+ onTap: _addToAlbum,
|
|
),
|
|
),
|
|
);
|
|
);
|
|
} else {
|
|
} else {
|
|
@@ -165,8 +161,7 @@ class _FileSelectionActionsWidgetState
|
|
SelectionActionButton(
|
|
SelectionActionButton(
|
|
icon: Icons.add_outlined,
|
|
icon: Icons.add_outlined,
|
|
labelText: S.of(context).addToAlbum,
|
|
labelText: S.of(context).addToAlbum,
|
|
- onTap: (anyOwnedFiles || _isInternalUser) ? _addToAlbum : null,
|
|
|
|
- shouldShow: ownedAndPendingUploadFilesCount > 0 || _isInternalUser,
|
|
|
|
|
|
+ onTap: _addToAlbum,
|
|
),
|
|
),
|
|
);
|
|
);
|
|
}
|
|
}
|
|
@@ -450,10 +445,6 @@ class _FileSelectionActionsWidgetState
|
|
}
|
|
}
|
|
|
|
|
|
Future<void> _addToAlbum() async {
|
|
Future<void> _addToAlbum() async {
|
|
- if (split.ownedByOtherUsers.isNotEmpty && !_isInternalUser) {
|
|
|
|
- widget.selectedFiles
|
|
|
|
- .unSelectAll(split.ownedByOtherUsers.toSet(), skipNotify: true);
|
|
|
|
- }
|
|
|
|
showCollectionActionSheet(context, selectedFiles: widget.selectedFiles);
|
|
showCollectionActionSheet(context, selectedFiles: widget.selectedFiles);
|
|
}
|
|
}
|
|
|
|
|