Skip to content

Commit

Permalink
Fixed contract once not running stop callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jul 11, 2023
1 parent 3c17cf5 commit 7d061b7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src.ts/contract/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,12 @@ async function _emit(contract: BaseContract, event: ContractEventName, args: Arr
} catch (error) { }
return !once;
});

if (sub.listeners.length === 0) {
sub.stop();
getInternal(contract).subs.delete(sub.tag);
}

return (count > 0);
}

Expand Down

0 comments on commit 7d061b7

Please # to comment.