Merge pull request #178 from ente-io/fix-shared-collection-chip-scrollTo
Fixes scroll to searched sharedCollection chip
This commit is contained in:
commit
51ca5f9ed7
1 changed files with 8 additions and 15 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue