diff --git a/src/entities/home/ui/favorite-wrapper.tsx b/src/entities/home/ui/favorite-wrapper.tsx index dedf75a..824ed15 100644 --- a/src/entities/home/ui/favorite-wrapper.tsx +++ b/src/entities/home/ui/favorite-wrapper.tsx @@ -20,6 +20,7 @@ export const FavoriteWrapper = ({ }: FavoriteWrapperProps) => { const { navigate } = useNavigate(); const { i18n, t } = useTranslation(); + const [swiperInstance, setSwiperInstance] = useState(null); const { menuOn, setMenuOn } = useMenuOnStore(); const { favoriteEditOn, setFavoriteEditOn } = useFavoriteEditOnStore(); @@ -34,6 +35,12 @@ export const FavoriteWrapper = ({ iconFilePath: IMAGE_ROOT + '/ico_menu_plus.svg', programPath: '', }; + + const goToLastSlide = () => { + if(swiperInstance){ + swiperInstance.slideTo(swiperInstance.slides.length - 1); + } + }; const onClickToFavoriteEdit = () => { setMenuOn(true); @@ -130,12 +137,18 @@ export const FavoriteWrapper = ({ }; useEffect(() => { + goToLastSlide(); getFavoriteList(); }, [changeMenuId, favoriteEditOn]); + useEffect(() => { + goToLastSlide(); + }, [menuIds]); + return ( <>