FIX: Scroll on multi sig creation

This commit is contained in:
marcosrdz 2021-02-07 22:54:04 -05:00
parent b935dbca32
commit b16d5b645f
2 changed files with 14 additions and 10 deletions

View File

@ -36,14 +36,16 @@ const DrawerList = props => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [wallets, pendingWallets]);
useEffect(() => {
if (walletsCount.current < wallets.length) {
walletsCarousel.current?.snapToItem(walletsCount.current);
}
walletsCount.current = wallets.length;
}, [wallets]);
useEffect(() => {
if (pendingWallets.length > 0) {
walletsCarousel.current?.snapToItem(carouselData.length - pendingWallets.length);
} else {
if (walletsCount.current <= wallets.length) {
walletsCarousel.current?.snapToItem(walletsCount.current - 1);
walletsCount.current = wallets.length;
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [pendingWallets]);

View File

@ -89,14 +89,16 @@ const WalletsList = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [wallets, pendingWallets]);
useEffect(() => {
if (walletsCount.current < wallets.length) {
walletsCarousel.current?.snapToItem(walletsCount.current);
}
walletsCount.current = wallets.length;
}, [wallets]);
useEffect(() => {
if (pendingWallets.length > 0) {
walletsCarousel.current?.snapToItem(carouselData.length - pendingWallets.length);
} else {
if (walletsCount.current <= wallets.length) {
walletsCarousel.current?.snapToItem(walletsCount.current - 1);
walletsCount.current = wallets.length;
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [pendingWallets]);