mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-02 22:04:32 +01:00
add check-types command and fix type errors
This commit is contained in:
@@ -21,8 +21,8 @@ import { DIALOG_CONTENT, DIALOG_POSITIONER } from "~/styles/dialogs";
|
||||
import { InfoBox } from "./InfoBox";
|
||||
import { Network } from "~/logic/mutinyWalletSetup";
|
||||
import { FeesModal } from "./MoreInfoModal";
|
||||
import { useNavigate } from "@solidjs/router";
|
||||
import { useI18n } from "~/i18n/context";
|
||||
import { useNavigate } from "solid-start";
|
||||
|
||||
const FIXED_AMOUNTS_SATS = [
|
||||
{ label: "10k", amount: "10000" },
|
||||
@@ -70,7 +70,7 @@ function SingleDigitButton(props: {
|
||||
fiat: boolean;
|
||||
}) {
|
||||
const i18n = useI18n();
|
||||
let holdTimer: number;
|
||||
let holdTimer: ReturnType<typeof setTimeout> | undefined;
|
||||
const holdThreshold = 500;
|
||||
|
||||
function onHold() {
|
||||
|
||||
@@ -2,12 +2,11 @@ import { onCleanup, onMount } from "solid-js";
|
||||
import {
|
||||
BarcodeScanner,
|
||||
BarcodeFormat,
|
||||
CameraPermissionState,
|
||||
CameraPermissionType,
|
||||
CameraPluginPermissions,
|
||||
PermissionStates
|
||||
PermissionStates,
|
||||
ScanResult
|
||||
} from "@mutinywallet/barcode-scanner";
|
||||
import QrScanner from "qr-scanner";
|
||||
import { Capacitor } from "@capacitor/core";
|
||||
|
||||
export default function Scanner(props: { onResult: (result: string) => void }) {
|
||||
let container: HTMLVideoElement | undefined;
|
||||
@@ -22,7 +21,7 @@ export default function Scanner(props: { onResult: (result: string) => void }) {
|
||||
const permissions: PermissionStates =
|
||||
await BarcodeScanner.checkPermissions();
|
||||
if (permissions.camera === "granted") {
|
||||
const callback = (result: ScanResult, err?: any) => {
|
||||
const callback = (result: ScanResult, err?: unknown) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
@@ -33,7 +32,7 @@ export default function Scanner(props: { onResult: (result: string) => void }) {
|
||||
}
|
||||
};
|
||||
await BarcodeScanner.start(
|
||||
{ targetedFormats: [BarcodeFormat.QR_CODE] },
|
||||
{ formats: [BarcodeFormat.QR_CODE] },
|
||||
callback
|
||||
);
|
||||
} else if (permissions.camera === "prompt") {
|
||||
|
||||
Reference in New Issue
Block a user