File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1- import { useCallback , useState } from "react" ;
1+ import { useCallback , useEffect , useState } from "react" ;
22
33import Link from "next/link" ;
44import { useRouter } from "next/router" ;
55
6- import { indexer } from "@/common/api/indexer" ;
6+ import { indexer , syncApi } from "@/common/api/indexer" ;
77import { PageWithBanner } from "@/common/ui/layout/components" ;
88import { cn } from "@/common/ui/layout/utils" ;
99import { useWalletUserSession } from "@/common/wallet" ;
@@ -36,6 +36,13 @@ export const PotLayout: React.FC<PotLayoutProps> = ({ children }) => {
3636 const { activeTab, orderedTabList } = usePotLayoutTabNavigation ( { potId } ) ;
3737 const { data : pot } = indexer . usePot ( { potId } ) ;
3838
39+ // Sync pot donations when returning from a wallet transaction (?done=true)
40+ useEffect ( ( ) => {
41+ if ( query . done && potId ) {
42+ syncApi . potDonations ( potId ) . catch ( ( ) => { } ) ;
43+ }
44+ } , [ query . done , potId ] ) ;
45+
3946 // Modals
4047 const [ resultModalOpen , setSuccessModalOpen ] = useState ( ! ! query . done && ! query . errorMessage ) ;
4148 const [ errorModalOpen , setErrorModalOpen ] = useState ( ! ! query . errorMessage ) ;
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ export const FeaturedCampaigns = ({
3434 api . on ( "select" , ( ) => {
3535 setCurrent ( api . selectedScrollSnap ( ) ) ;
3636 } ) ;
37+
38+ const interval = setInterval ( ( ) => {
39+ api . scrollNext ( ) ;
40+ } , 5000 ) ;
41+
42+ return ( ) => clearInterval ( interval ) ;
3743 } , [ api ] ) ;
3844
3945 if ( ! data ?. length ) {
You can’t perform that action at this time.
0 commit comments