diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index a67608e4fd..ba6b8eafbe 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -109,7 +109,6 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) { function clearInstanceList (self) { event.trigger('clearInstance', []) - self._view.recorderCount.innerText = 0 } function setFinalContext () { @@ -200,6 +199,10 @@ function makeRecorder (appAPI, appEvents, opts, self) { self.data.count = count self._view.recorderCount.innerText = count }) + recorder.event.register('cleared', () => { + self.data.count = 0 + self._view.recorderCount.innerText = 0 + }) var css2 = csjs` .container {} .runTxs {} @@ -225,7 +228,6 @@ function makeRecorder (appAPI, appEvents, opts, self) { modalDialogCustom.alert('Failed to create file ' + newFile) } else { appAPI.switchFile(newFile) - self._view.recorderCount.innerText = 0 } }) } diff --git a/src/recorder.js b/src/recorder.js index 630d7152f0..0ba76dbbca 100644 --- a/src/recorder.js +++ b/src/recorder.js @@ -168,6 +168,7 @@ class Recorder { self.data._abis = {} self.data._contractABIReferences = {} self.data._linkReferences = {} + self.event.trigger('cleared', []) } /**