chrome-banner: log success of retrieving configs

This commit is contained in:
horymury 2020-02-18 11:56:09 +02:00 committed by GitHub
parent 15fb8a1525
commit 86130c1478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 12 deletions

View File

@ -102,11 +102,19 @@ class ChromeExtensionBanner extends PureComponent<Props, State> {
* *
* @inheritdoc * @inheritdoc
*/ */
async componentDidUpdate() { async componentDidUpdate(prevProps) {
if (!this._isSupportedEnvironment()) { if (!this._isSupportedEnvironment()) {
return; return;
} }
if (this.props.chromeExtensionUrl && !prevProps.chromeExtensionUrl) {
logger.info('Chrome extension URL found.');
}
if (this.props.chromeExtensionsInfo.length && !prevProps.chromeExtensionsInfo.length) {
logger.info('Chrome extension(s) info found.');
}
const hasExtensions = await this._checkExtensionsInstalled(); const hasExtensions = await this._checkExtensionsInstalled();
if ( if (
@ -175,10 +183,6 @@ class ChromeExtensionBanner extends PureComponent<Props, State> {
}); });
const extensionInstalledFunction = info => isExtensionInstalled(info); const extensionInstalledFunction = info => isExtensionInstalled(info);
if (!this.props.chromeExtensionsInfo.length) {
logger.warn('Further configuration needed, missing chrome extension(s) info');
}
return Promise.all( return Promise.all(
this.props.chromeExtensionsInfo.map(info => extensionInstalledFunction(info)) this.props.chromeExtensionsInfo.map(info => extensionInstalledFunction(info))
); );
@ -196,15 +200,10 @@ class ChromeExtensionBanner extends PureComponent<Props, State> {
return true; return true;
} }
if (!this.props.chromeExtensionUrl) {
logger.warn('Further configuration needed, missing chrome extension URL');
return true;
}
const dontShowAgain = localStorage.getItem(DONT_SHOW_AGAIN_CHECKED) === 'true'; const dontShowAgain = localStorage.getItem(DONT_SHOW_AGAIN_CHECKED) === 'true';
return dontShowAgain return !this.props.chromeExtensionUrl
|| dontShowAgain
|| this.state.closePressed || this.state.closePressed
|| !this.state.shouldShow || !this.state.shouldShow
|| this.props.iAmRecorder; || this.props.iAmRecorder;