Update content of files

This commit is contained in:
GitHub Action 2024-03-14 11:40:41 +00:00
parent cb8585d88f
commit 652b8600c1
4 changed files with 11 additions and 3 deletions

View file

@ -1101,6 +1101,7 @@
var isAccessRequested = false;
var isAccessGranted = false;
var isBiometricTokenSaved = false;
var deviceId = '';
var biometricManager = {};
Object.defineProperty(biometricManager, 'isInited', {
@ -1127,6 +1128,10 @@
get: function(){ return isBiometricTokenSaved; },
enumerable: true
});
Object.defineProperty(biometricManager, 'deviceId', {
get: function(){ return deviceId || ''; },
enumerable: true
});
var initRequestState = {callbacks: []};
var accessRequestState = false;
@ -1158,6 +1163,7 @@
isAccessGranted = false;
isBiometricTokenSaved = false;
}
deviceId = eventData.device_id || '';
if (initRequestState.callbacks.length > 0) {
for (var i = 0; i < initRequestState.callbacks.length; i++) {

View file

@ -9,7 +9,7 @@
<meta name="MobileOptimized" content="176" />
<meta name="HandheldFriendly" content="True" />
<meta name="robots" content="noindex, nofollow" />
<script src="https://tg.dev/js/telegram-web-app.js?44"></script>
<script src="https://tg.dev/js/telegram-web-app.js?45"></script>
<script>
function setThemeClass() {
document.documentElement.className = Telegram.WebApp.colorScheme;

View file

@ -8,7 +8,7 @@
<meta name="MobileOptimized" content="176" />
<meta name="HandheldFriendly" content="True" />
<meta name="robots" content="noindex,nofollow" />
<script src="https://tg.dev/js/telegram-web-app.js?44"></script>
<script src="https://tg.dev/js/telegram-web-app.js?45"></script>
<script>
function setThemeClass() {
document.documentElement.className = Telegram.WebApp.colorScheme;
@ -130,6 +130,7 @@
<li>access_requested: <span class="txt" id="bm_access_requested">false</span> (<a href="javascript:;" onclick="return DemoApp.biometricRequestAccess(this);">Request access</a>) <span></span></li>
<li>access_granted: <span class="txt" id="bm_access_granted">false</span> <span id="bm_settings" style="display:none;">(<a href="javascript:;" onclick="return DemoApp.biometricOpenSettings(this);">Open settings</a>)</span></li>
<li>token_saved: <span class="txt" id="bm_token_saved">false</span> (<a href="javascript:;" onclick="return DemoApp.biometricSetToken(this);">Set token</a>, <a href="javascript:;" onclick="return DemoApp.biometricRemoveToken(this);">Remove token</a>) <span></span></li>
<li>device_id: <span class="txt" id="bm_device_id"></span></li>
<li><a href="javascript:;" onclick="return DemoApp.biometricRequestAuth(this);">Request auth</a> <span></span></li>
</ul>
</div>
@ -151,7 +152,7 @@
<div class="viewport-stable_border"></div>
<script src="/js/jquery.min.js"></script>
<script src="https://tg.dev/js/bootstrap.min.js"></script>
<script src="/js/webappdemo.js?26"></script>
<script src="/js/webappdemo.js?27"></script>
<script>DemoApp.apiUrl = "/demo/api";
Telegram.WebApp.onEvent('themeChanged', function() {

View file

@ -299,6 +299,7 @@ var DemoApp = {
$('#bm_access_requested').text(biometricManager.isAccessRequested ? 'true' : 'false');
$('#bm_access_granted').text(biometricManager.isAccessGranted ? 'true' : 'false');
$('#bm_token_saved').text(biometricManager.isBiometricTokenSaved ? 'true' : 'false');
$('#bm_device_id').text(biometricManager.deviceId || '');
$('#bm_settings').toggle(!!(biometricManager.isAvailable && biometricManager.isAccessRequested && !biometricManager.isAccessGranted));
});
}