Quellcode durchsuchen

update view more frequently in case the onload function takes too long

David vor 9 Jahren
Ursprung
Commit
a39da1ca13
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      src/scenes/Clase/Teoria.js

+ 1 - 1
src/scenes/Clase/Teoria.js

@@ -8,7 +8,7 @@ class Teoria extends Component {
 	state = { webViewHeight: 200 };
 	state = { webViewHeight: 200 };
 
 
 	render() {
 	render() {
-		const script = '<script>function p(){ window.postMessage(document.body.scrollHeight); } window.onload = function(e) { p(); }; setInterval(p, 10000);</script>'
+		const script = '<script>function p(){ window.postMessage(document.body.scrollHeight); } window.onload = function(e) { p(); }; setTimeout(p, 300); setTimeout(p, 3000); setInterval(p, 10000);</script>'
 		const body = `<html><head>${script}</head><body>${this.props.texto}</body></html>`;
 		const body = `<html><head>${script}</head><body>${this.props.texto}</body></html>`;
 		return (
 		return (
 			<ScrollView style={{ flex: 1 }}>
 			<ScrollView style={{ flex: 1 }}>