fix: show deploy banner only on new contract deployment#1624
fix: show deploy banner only on new contract deployment#1624PratikshaGayen wants to merge 1 commit into
Conversation
Previously, notify() was called unconditionally in addDeployedContract(), causing the banner to appear multiple times when a contract was redeployed or the function was called more than once for the same contract. Now the notification is only triggered when index === -1, i.e. when it is a genuinely new deployment. Fixes genlayerlabs#628
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change modifies ChangesDeployment Success Notification
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #628
The deploy banner was showing up multiple times when deploying a contract.
The issue was in
addDeployedContract()infrontend/src/stores/contracts.ts—notify()was being called unconditionally after the if/else block, so it firedwhether the contract was new or just being redeployed.
Moved
notify()inside theif (index === -1)branch so it only triggerson a fresh deployment.
Summary by CodeRabbit