Skip to content

Commit 3113d2a

Browse files
authored
Merge pull request #607 from PotLock/staging
Staging
2 parents 3041f9c + 10fd191 commit 3113d2a

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/layout/pot/components/layout.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { useCallback, useState } from "react";
1+
import { useCallback, useEffect, useState } from "react";
22

33
import Link from "next/link";
44
import { useRouter } from "next/router";
55

6-
import { indexer } from "@/common/api/indexer";
6+
import { indexer, syncApi } from "@/common/api/indexer";
77
import { PageWithBanner } from "@/common/ui/layout/components";
88
import { cn } from "@/common/ui/layout/utils";
99
import { 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);

src/pages/campaigns.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)