From 41790513f833ebbe7e90f77fc127f2ae9ac77abf Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 15 May 2018 12:58:13 +0200 Subject: [PATCH] fix recorder count --- src/app/tabs/run-tab.js | 6 ++++-- src/recorder.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) 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', []) } /**