aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/yomichan.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-09-13 22:43:16 -0700
committerAlex Yatskov <alex@foosoft.net>2016-09-13 22:43:16 -0700
commitff3896ed01024e612f9a80fb898f84afac98fc6b (patch)
tree1da02ec14bc0526f53de2a21b2d23ac652c25cd8 /ext/bg/js/yomichan.js
parent17366e521afe2dd3b32f2068db43f972ce89b36f (diff)
Fix progress counting
Diffstat (limited to 'ext/bg/js/yomichan.js')
-rw-r--r--ext/bg/js/yomichan.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js
index 10a42f47..c9f53253 100644
--- a/ext/bg/js/yomichan.js
+++ b/ext/bg/js/yomichan.js
@@ -47,6 +47,10 @@ class Yomichan {
}
}
+ onImport({state, progress}) {
+ console.log(`${state}: ${progress}`);
+ }
+
onMessage(request, sender, callback) {
const {action, params} = request, method = this['api_' + action];
@@ -90,7 +94,7 @@ class Yomichan {
break;
case 'loading':
chrome.browserAction.setBadgeText({text: '...'});
- this.translator.loadData().then(() => this.setState('enabled'));
+ this.translator.loadData(this.onImport.bind(this)).then(() => this.setState('enabled'));
break;
}