Merge pull request #178 from ente-io/fix-shared-collection-chip-scrollTo

Fixes scroll to searched sharedCollection chip
This commit is contained in:
Abhinav-grd 2021-10-18 10:59:21 +05:30 committed by GitHub
commit 51ca5f9ed7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -186,11 +186,6 @@ export default function Gallery() {
useState<Map<number, number>>();
const [activeCollection, setActiveCollection] = useState<number>(undefined);
const [isSharedCollectionActive, setIsSharedCollectionActive] =
useState(false);
const [isFavCollectionActive, setIsFavCollectionActive] = useState(false);
useEffect(() => {
const key = getKey(SESSION_KEYS.ENCRYPTION_KEY);
if (!key) {
@ -248,14 +243,6 @@ export default function Gallery() {
}
const href = `/gallery${collectionURL}`;
router.push(href, undefined, { shallow: true });
setIsSharedCollectionActive(
isSharedCollection(activeCollection, collections)
);
setIsFavCollectionActive(
isFavoriteCollection(activeCollection, collections)
);
}, [activeCollection]);
const syncWithRemote = async (force = false, silent = false) => {
@ -627,7 +614,10 @@ export default function Gallery() {
deleted={deleted}
setDialogMessage={setDialogMessage}
activeCollection={activeCollection}
isSharedCollection={isSharedCollectionActive}
isSharedCollection={isSharedCollection(
activeCollection,
collections
)}
/>
{selected.count > 0 &&
selected.collectionID === activeCollection && (
@ -655,7 +645,10 @@ export default function Gallery() {
count={selected.count}
clearSelection={clearSelection}
activeCollection={activeCollection}
isFavoriteCollection={isFavCollectionActive}
isFavoriteCollection={isFavoriteCollection(
activeCollection,
collections
)}
/>
)}
</FullScreenDropZone>