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
*/
async componentDidUpdate() {
async componentDidUpdate(prevProps) {
if (!this._isSupportedEnvironment()) {
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();
if (
@ -175,10 +183,6 @@ class ChromeExtensionBanner extends PureComponent<Props, State> {
});
const extensionInstalledFunction = info => isExtensionInstalled(info);
if (!this.props.chromeExtensionsInfo.length) {
logger.warn('Further configuration needed, missing chrome extension(s) info');
}
return Promise.all(
this.props.chromeExtensionsInfo.map(info => extensionInstalledFunction(info))
);
@ -196,15 +200,10 @@ class ChromeExtensionBanner extends PureComponent<Props, State> {
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';
return dontShowAgain
return !this.props.chromeExtensionUrl
|| dontShowAgain
|| this.state.closePressed
|| !this.state.shouldShow
|| this.props.iAmRecorder;