Skip to content

Commit e5f0620

Browse files
committed
Only add timeout if delay > 0
1 parent 5d4a216 commit e5f0620

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/src/main/res/raw/webviewcompat_test_script.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ const webViewCompatPingMessage = 'Ping:' + window.location.href + ' ' + delay +
88

99

1010
if (postInitialPing) {
11-
setTimeout(() => {
11+
if (delay > 0) {
12+
setTimeout(() => {
13+
webViewCompatTestObj.postMessage(webViewCompatPingMessage)
14+
}, delay)
15+
} else {
1216
webViewCompatTestObj.postMessage(webViewCompatPingMessage)
13-
}, delay)
17+
}
1418
}
1519

1620

0 commit comments

Comments
 (0)