Selaa lähdekoodia

chrome-banner: log success of retrieving configs

master
horymury 5 vuotta sitten
vanhempi
commit
86130c1478
No account linked to committer's email address

+ 11
- 12
react/features/chrome-extension-banner/components/ChromeExtensionBanner.web.js Näytä tiedosto

102
      *
102
      *
103
      * @inheritdoc
103
      * @inheritdoc
104
      */
104
      */
105
-    async componentDidUpdate() {
105
+    async componentDidUpdate(prevProps) {
106
         if (!this._isSupportedEnvironment()) {
106
         if (!this._isSupportedEnvironment()) {
107
             return;
107
             return;
108
         }
108
         }
109
 
109
 
110
+        if (this.props.chromeExtensionUrl && !prevProps.chromeExtensionUrl) {
111
+            logger.info('Chrome extension URL found.');
112
+        }
113
+
114
+        if (this.props.chromeExtensionsInfo.length && !prevProps.chromeExtensionsInfo.length) {
115
+            logger.info('Chrome extension(s) info found.');
116
+        }
117
+
110
         const hasExtensions = await this._checkExtensionsInstalled();
118
         const hasExtensions = await this._checkExtensionsInstalled();
111
 
119
 
112
         if (
120
         if (
175
         });
183
         });
176
         const extensionInstalledFunction = info => isExtensionInstalled(info);
184
         const extensionInstalledFunction = info => isExtensionInstalled(info);
177
 
185
 
178
-        if (!this.props.chromeExtensionsInfo.length) {
179
-            logger.warn('Further configuration needed, missing chrome extension(s) info');
180
-        }
181
-
182
         return Promise.all(
186
         return Promise.all(
183
             this.props.chromeExtensionsInfo.map(info => extensionInstalledFunction(info))
187
             this.props.chromeExtensionsInfo.map(info => extensionInstalledFunction(info))
184
         );
188
         );
196
             return true;
200
             return true;
197
         }
201
         }
198
 
202
 
199
-        if (!this.props.chromeExtensionUrl) {
200
-            logger.warn('Further configuration needed, missing chrome extension URL');
201
-
202
-            return true;
203
-        }
204
-
205
         const dontShowAgain = localStorage.getItem(DONT_SHOW_AGAIN_CHECKED) === 'true';
203
         const dontShowAgain = localStorage.getItem(DONT_SHOW_AGAIN_CHECKED) === 'true';
206
 
204
 
207
-        return dontShowAgain
205
+        return !this.props.chromeExtensionUrl
206
+            || dontShowAgain
208
             || this.state.closePressed
207
             || this.state.closePressed
209
             || !this.state.shouldShow
208
             || !this.state.shouldShow
210
             || this.props.iAmRecorder;
209
             || this.props.iAmRecorder;

Loading…
Peruuta
Tallenna