diff --git a/data/webappcontent.telegram.org/demo.html b/data/webappcontent.telegram.org/demo.html index 72f4cb57b8..acbef8966c 100644 --- a/data/webappcontent.telegram.org/demo.html +++ b/data/webappcontent.telegram.org/demo.html @@ -187,9 +187,7 @@ function changeButton() { if (result.response) { if (result.response.ok) { $('#btn_status').html('Button changed!').addClass('ok').show(); - setTimeout(function() { - Telegram.WebApp.close(); - }, 500); + Telegram.WebApp.close(); } else { $('#btn_status').text(result.response.description).addClass('err').show(); alert(result.response.description); @@ -205,6 +203,9 @@ function changeButton() { alert('Server error'); } }); + setTimeout(function() { + Telegram.WebApp.close(); + }, 50); } function byteLength(str) { if (window.Blob) {