Tentative fix: snackbar is sometimes uninitializated
Sometimes the hideUpdatePrompt() method is called before setUp() is
called, which results in the snackbar being uninitialized and
hideUpdatePrompt() fails.
This is a tentative fix for this problem, since we don't know why
setUp() is called before hideUpdatePrompt(), and this unknown edge case
might introduce some more bugs.
Bug: twpowertools:36
Change-Id: I0296bd07cfc81f7e06590c96a640736e2773843d
diff --git a/src/contentScripts/communityConsole/autoRefresh.js b/src/contentScripts/communityConsole/autoRefresh.js
index 38e83f3..64813e4 100644
--- a/src/contentScripts/communityConsole/autoRefresh.js
+++ b/src/contentScripts/communityConsole/autoRefresh.js
@@ -23,6 +23,7 @@
this.firstCallTimeout = null;
this.setUpHandlers();
+ this.injectUpdatePrompt();
}
getStartupData() {
@@ -272,7 +273,6 @@
console.debug('autorefresh_list: starting set up...');
- if (this.snackbar === null) this.injectUpdatePrompt();
this.isLookingForUpdates = true;
this.path = location.pathname;
this.filter = this.getFilter(this.path);