mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 08:44:25 +08:00
migrate app lock settings page to composition API and typescript
This commit is contained in:
+1
-5
@@ -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))));
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user