Update content of files

This commit is contained in:
GitHub Action 2024-03-11 10:56:43 +00:00
parent a849ee5851
commit ecace47c4b
4 changed files with 9 additions and 6 deletions

View file

@ -1174,7 +1174,7 @@
}
receiveWebViewEvent('biometricManagerUpdated');
}
function onBiometryAuthRequested() {
function onBiometryAuthRequested(eventType, eventData) {
var isAuthenticated = (eventData.status == 'authorized'),
biometricToken = eventData.token || '';
if (authRequestState) {
@ -1191,7 +1191,7 @@
isAuthenticated: false
});
}
function onBiometryTokenUpdated() {
function onBiometryTokenUpdated(eventType, eventData) {
var applied = false;
if (isBiometricAvailable &&
isAccessRequested) {
@ -1285,7 +1285,7 @@
WebView.postEvent('web_app_biometry_request_auth', false);
return biometricManager;
};
biometricManager.saveBiometricToken = function(token, callback) {
biometricManager.updateBiometricToken = function(token, callback) {
if (!checkVersion()) {
return biometricManager;
}

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?42"></script>
<script src="https://tg.dev/js/telegram-web-app.js?43"></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?42"></script>
<script src="https://tg.dev/js/telegram-web-app.js?43"></script>
<script>
function setThemeClass() {
document.documentElement.className = Telegram.WebApp.colorScheme;
@ -151,7 +151,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?23"></script>
<script src="/js/webappdemo.js?24"></script>
<script>DemoApp.apiUrl = "/demo/api";
Telegram.WebApp.onEvent('themeChanged', function() {

View file

@ -321,6 +321,7 @@ var DemoApp = {
if (!biometricManager.isInited) {
return DemoApp.showAlert('Biometric not inited yet!');
}
$(el).next('span').text('').attr('class', '');
biometricManager.authenticate(function(success, token) {
if (success) {
$(el).next('span').text('(Success, token: ' + token + ')').attr('class', 'ok');
@ -337,6 +338,7 @@ var DemoApp = {
var token = parseInt(Math.random().toString().substr(2)).toString(16);
biometricManager.updateBiometricToken(token, function(updated) {
if (updated) {
$('#bm_token_saved').text(biometricManager.isBiometricTokenSaved ? 'true' : 'false');
$(el).next('span').text('(Updated)').attr('class', 'ok');
} else {
$(el).next('span').text('(Failed)').attr('class', 'err');
@ -350,6 +352,7 @@ var DemoApp = {
}
biometricManager.updateBiometricToken('', function(updated) {
if (updated) {
$('#bm_token_saved').text(biometricManager.isBiometricTokenSaved ? 'true' : 'false');
$(el).next('span').text('(Removed)').attr('class', 'ok');
} else {
$(el).next('span').text('(Failed)').attr('class', 'err');