Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix

Vishnu Mohandas1fae8181b7a1
diff --git a/web/apps/locker/src/components/ItemDetailView.tsx b/web/apps/locker/src/components/ItemDetailView.tsx
index 33eb16d8b2..b612b90b17 100644
--- a/web/apps/locker/src/components/ItemDetailView.tsx
+++ b/web/apps/locker/src/components/ItemDetailView.tsx
@@ -249,7 +249,7 @@ export const ItemDetailView: React.FC<ItemDetailViewProps> = ({
)}
</>
)}
- {item.type !== "file" && onShareLink && (
+ {onShareLink && (
<Button
variant="outlined"
startIcon={<ShareOutlinedIcon />}
diff --git a/web/apps/locker/src/pages/locker.tsx b/web/apps/locker/src/pages/locker.tsx
index 88952ee102..82dac5624e 100644
--- a/web/apps/locker/src/pages/locker.tsx
+++ b/web/apps/locker/src/pages/locker.tsx
@@ -692,21 +692,35 @@ export const LockerPage: React.FC = () => {
[refreshData, selectedCollectionID, showMiniDialog],
);
- const handleEditItem = useCallback((item: LockerItem) => {
- setEditItem({
- id: item.id,
- type: item.type,
- data:
- item.type === "file"
- ? { name: getItemTitle(item) }
- : (item.data as unknown as Record<string, unknown>),
- collectionID: item.collectionID,
- collectionIDs:
- item.collectionIDs.length > 0
- ? item.collectionIDs
- : [item.collectionID],
- });
- }, []);
+ const handleEditItem = useCallback(
+ (item: LockerItem) => {
+ const fullCollectionIDs = Array.from(
+ new Set([
+ ...item.collectionIDs,
+ item.collectionID,
+ ...collections
+ .filter((collection) =>
+ collection.items.some(
+ (candidate) => candidate.id === item.id,
+ ),
+ )
+ .map((collection) => collection.id),
+ ]),
+ );
+
+ setEditItem({
+ id: item.id,
+ type: item.type,
+ data:
+ item.type === "file"
+ ? { name: getItemTitle(item) }
+ : (item.data as unknown as Record<string, unknown>),
+ collectionID: item.collectionID,
+ collectionIDs: fullCollectionIDs,
+ });
+ },
+ [collections],
+ );
// Trash operations