|
@@ -6,6 +6,7 @@ import { translate } from '../../base/i18n';
|
6
|
6
|
import { getCurrentConference } from '../../base/conference/functions';
|
7
|
7
|
import { browser } from '../../base/lib-jitsi-meet';
|
8
|
8
|
import { isMobileBrowser } from '../../base/environment/utils';
|
|
9
|
+import logger from '../logger';
|
9
|
10
|
|
10
|
11
|
declare var interfaceConfig: Object;
|
11
|
12
|
|
|
@@ -102,6 +103,10 @@ class ChromeExtensionBanner extends PureComponent<Props, State> {
|
102
|
103
|
* @inheritdoc
|
103
|
104
|
*/
|
104
|
105
|
async componentDidUpdate() {
|
|
106
|
+ if (!this._isSupportedEnvironment()) {
|
|
107
|
+ return;
|
|
108
|
+ }
|
|
109
|
+
|
105
|
110
|
const hasExtensions = await this._checkExtensionsInstalled();
|
106
|
111
|
|
107
|
112
|
if (
|
|
@@ -114,6 +119,18 @@ class ChromeExtensionBanner extends PureComponent<Props, State> {
|
114
|
119
|
}
|
115
|
120
|
}
|
116
|
121
|
|
|
122
|
+ /**
|
|
123
|
+ * Checks whether the feature is enabled and whether the environment(browser/os)
|
|
124
|
+ * supports it.
|
|
125
|
+ *
|
|
126
|
+ * @returns {boolean}
|
|
127
|
+ */
|
|
128
|
+ _isSupportedEnvironment() {
|
|
129
|
+ return interfaceConfig.SHOW_CHROME_EXTENSION_BANNER
|
|
130
|
+ && browser.isChrome()
|
|
131
|
+ && !isMobileBrowser();
|
|
132
|
+ }
|
|
133
|
+
|
117
|
134
|
_onClosePressed: () => void;
|
118
|
135
|
|
119
|
136
|
/**
|
|
@@ -159,7 +176,7 @@ class ChromeExtensionBanner extends PureComponent<Props, State> {
|
159
|
176
|
const extensionInstalledFunction = info => isExtensionInstalled(info);
|
160
|
177
|
|
161
|
178
|
if (!this.props.chromeExtensionsInfo.length) {
|
162
|
|
- console.warn('Further configuration needed, missing chrome extension(s) info');
|
|
179
|
+ logger.warn('Further configuration needed, missing chrome extension(s) info');
|
163
|
180
|
}
|
164
|
181
|
|
165
|
182
|
return Promise.all(
|
|
@@ -175,18 +192,19 @@ class ChromeExtensionBanner extends PureComponent<Props, State> {
|
175
|
192
|
* @returns {boolean} Whether to show the banner or not.
|
176
|
193
|
*/
|
177
|
194
|
_shouldNotRender() {
|
|
195
|
+ if (!this._isSupportedEnvironment()) {
|
|
196
|
+ return true;
|
|
197
|
+ }
|
|
198
|
+
|
178
|
199
|
if (!this.props.chromeExtensionUrl) {
|
179
|
|
- console.warn('Further configuration needed, missing chrome extension URL');
|
|
200
|
+ logger.warn('Further configuration needed, missing chrome extension URL');
|
180
|
201
|
|
181
|
202
|
return true;
|
182
|
203
|
}
|
183
|
204
|
|
184
|
205
|
const dontShowAgain = localStorage.getItem(DONT_SHOW_AGAIN_CHECKED) === 'true';
|
185
|
206
|
|
186
|
|
- return !interfaceConfig.SHOW_CHROME_EXTENSION_BANNER
|
187
|
|
- || !browser.isChrome()
|
188
|
|
- || isMobileBrowser()
|
189
|
|
- || dontShowAgain
|
|
207
|
+ return dontShowAgain
|
190
|
208
|
|| this.state.closePressed
|
191
|
209
|
|| !this.state.shouldShow
|
192
|
210
|
|| this.props.iAmRecorder;
|