1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Restore the setTimeout, add comments

This commit is contained in:
Henry Heino 2024-12-23 11:18:01 -08:00
parent 2a669b9aa2
commit 5558a39593

View File

@ -91,7 +91,11 @@ const ExtendedWebView = (props: Props, ref: Ref<WebViewControl>) => {
const refreshWebViewAfterCrash = useCallback(() => { const refreshWebViewAfterCrash = useCallback(() => {
// Reload the WebView on crash. See https://github.com/react-native-webview/react-native-webview/issues/3524 // Reload the WebView on crash. See https://github.com/react-native-webview/react-native-webview/issues/3524
logger.warn('Content process lost. Reloading the webview...'); logger.warn('Content process lost. Reloading the webview...');
shim.setTimeout(() => {
setReloadCounter(counter => counter + 1); setReloadCounter(counter => counter + 1);
// Restart after a brief delay to mitigate the case where the crash is due to
// an out-of-memory or content script bug.
}, 250);
}, []); }, []);
// - `setSupportMultipleWindows` must be `true` for security reasons: // - `setSupportMultipleWindows` must be `true` for security reasons: