Bladeren bron

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

David 9 jaren geleden
bovenliggende
commit
a39da1ca13
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  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 };
 
 	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>`;
 		return (
 			<ScrollView style={{ flex: 1 }}>