mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Merge remote-tracking branch 'origin/release-3.0' into dev
This commit is contained in:
commit
72472623cc
@ -7,10 +7,11 @@ import { _ } from '@joplin/lib/locale';
|
|||||||
|
|
||||||
const getWebViewVersionText = () => {
|
const getWebViewVersionText = () => {
|
||||||
if (Platform.OS === 'android') {
|
if (Platform.OS === 'android') {
|
||||||
const constants = NativeModules.SystemVersionInformationModule.getConstants();
|
// SystemVersionInformationModule is unavailable on older versions of Android.
|
||||||
|
const constants = NativeModules.SystemVersionInformationModule?.getConstants();
|
||||||
return [
|
return [
|
||||||
_('WebView version: %s', constants.webViewVersion),
|
_('WebView version: %s', constants?.webViewVersion ?? _('Unknown')),
|
||||||
_('WebView package: %s', constants.webViewPackage),
|
_('WebView package: %s', constants?.webViewPackage ?? _('Unknown')),
|
||||||
].join('\n');
|
].join('\n');
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -590,6 +590,7 @@ function shimInit(options: ShimInitOptions = null) {
|
|||||||
cleanUpOnError(error);
|
cleanUpOnError(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const requestStart = new Date();
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
const request = http.request(requestOptions, (response: any) => {
|
const request = http.request(requestOptions, (response: any) => {
|
||||||
|
|
||||||
@ -629,7 +630,10 @@ function shimInit(options: ShimInitOptions = null) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
request.on('timeout', () => {
|
request.on('timeout', () => {
|
||||||
request.destroy(new Error(`Request timed out. Timeout value: ${requestOptions.timeout}ms.`));
|
// We choose to not destroy the request when a timeout value is not specified to keep
|
||||||
|
// the behavior we had before the addition of this event handler.
|
||||||
|
if (!requestOptions.timeout) return;
|
||||||
|
request.destroy(new Error(`Request timed out. Timeout value: ${requestOptions.timeout}ms. Actual connection time: ${new Date().getTime() - requestStart.getTime()}ms`));
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||||
|
Loading…
Reference in New Issue
Block a user