From 9c4efa0e224f0a914932d9c5818eae76d55596e9 Mon Sep 17 00:00:00 2001 From: PratikshaGayen Date: Sun, 10 May 2026 09:11:53 +0530 Subject: [PATCH] fix: show deploy banner only on new contract deployment 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 #628 --- frontend/src/stores/contracts.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/src/stores/contracts.ts b/frontend/src/stores/contracts.ts index 3d0868b85..ebd00e2c1 100644 --- a/frontend/src/stores/contracts.ts +++ b/frontend/src/stores/contracts.ts @@ -140,14 +140,13 @@ export const useContractsStore = defineStore('contractsStore', () => { if (index === -1) { allDeployedContracts.value.push(newItem); + notify({ + title: 'Contract deployed', + type: 'success', + }); } else { allDeployedContracts.value.splice(index, 1, newItem); } - - notify({ - title: 'Contract deployed', - type: 'success', - }); } function removeDeployedContract(contractId: string): void {