migrate app lock settings page to composition API and typescript

This commit is contained in:
MaysWind
2025-01-16 22:37:35 +08:00
parent adebc96637
commit 4f21762533
7 changed files with 310 additions and 301 deletions
+1 -5
View File
@@ -230,11 +230,7 @@ export function getTextAfter(fullText: string, text: string): string {
return '';
}
export function base64encode(arrayBuffer: ArrayBuffer): string | null {
if (!arrayBuffer) {
return null;
}
export function base64encode(arrayBuffer: ArrayBuffer): string {
return btoa(String.fromCharCode.apply(null, Array.from(new Uint8Array(arrayBuffer))));
}
+2 -2
View File
@@ -21,7 +21,7 @@ export interface Framework7Dom {
type TranslateFunction = (message: string) => string;
export function showAlert(message: string, confirmCallback: (dialog: Dialog.Dialog, e: Event) => void, translateFn: TranslateFunction): void {
export function showAlert(message: string, confirmCallback: ((dialog: Dialog.Dialog, e: Event) => void) | undefined, translateFn: TranslateFunction): void {
f7ready((f7) => {
f7.dialog.create({
title: translateFn('global.app.title'),
@@ -229,7 +229,7 @@ export function useI18nUIComponents() {
}
return {
showAlert: (message: string, confirmCallback: (dialog: Dialog.Dialog, e: Event) => void) => showAlert(message, confirmCallback, i18nGlobal.t),
showAlert: (message: string, confirmCallback?: (dialog: Dialog.Dialog, e: Event) => void) => showAlert(message, confirmCallback, i18nGlobal.t),
showConfirm: (message: string, confirmCallback: (dialog: Dialog.Dialog, e: Event) => void, cancelCallback?: (dialog: Dialog.Dialog, e: Event) => void): void => showConfirm(message, confirmCallback, cancelCallback, i18nGlobal.t),
showToast: (message: string, timeout?: number): void => showToast(message, timeout, i18nGlobal.t),
routeBackOnError
+2 -2
View File
@@ -28,7 +28,7 @@ interface AttestationData {
}
interface WebAuthnRegisterResponse {
readonly id: string | null;
readonly id: string;
readonly clientData: ClientData;
readonly publicKey: Uint8Array | null;
readonly rawCredential: Credential;
@@ -198,7 +198,7 @@ export function verifyWebAuthnCredential(userInfo: UserBasicInfo, credentialId:
clientData && clientData.type === 'webauthn.get' && challengeFromClientData === challenge &&
userIdParts && userIdParts.length === 2 && userIdParts[0] === userInfo.username) {
const ret: WebAuthnVerifyResponse = {
id: base64encode(rawCredential.rawId) as string,
id: base64encode(rawCredential.rawId),
userName: userIdParts[0],
userSecret: userIdParts[1],
clientData: clientData,