Skip to content

Commit b952317

Browse files
Merge pull request #79 from StabilityNexus/Frontend
AutoSync to the Blocchain Added
2 parents 861b818 + 161d307 commit b952317

File tree

2 files changed

+228
-287
lines changed

2 files changed

+228
-287
lines changed

web/src/app/create/page.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,21 @@ export default function CreateCAT() {
225225
message: "CAT contract deployed successfully!",
226226
});
227227

228+
// Trigger sync notification for my-cats page
229+
localStorage.setItem('catCreated', JSON.stringify({
230+
timestamp: Date.now(),
231+
chainId: config.state.chainId,
232+
hash: deployData
233+
}));
234+
235+
// Dispatch custom event for immediate sync if my-cats page is open
236+
window.dispatchEvent(new CustomEvent('catCreated', {
237+
detail: { chainId: config.state.chainId, hash: deployData }
238+
}));
239+
228240
// Add a small delay before redirecting to ensure the blockchain state is updated
229241
setTimeout(() => {
230-
router.push("/my-cats");
242+
router.push("/my-cats?sync=true");
231243
setIsDeploying(false);
232244
}, 2000);
233245
} catch (error) {

0 commit comments

Comments
 (0)