Skip to content

Commit

Permalink
fix: do not show QR scan for RSK
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 committed Nov 6, 2024
1 parent 058a4a7 commit fce87d1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 32 deletions.
8 changes: 3 additions & 5 deletions src/components/QrScan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ const QrScan = () => {
let qrScanner: QrScanner;

const { swapType, setInvoice, setOnchainAddress } = useCreateContext();
const { t, camera, notify, setCamera } = useGlobalContext();
const { t, notify } = useGlobalContext();

const [camera, setCamera] = createSignal<boolean>(false);
const [scanning, setScanning] = createSignal(false);

onMount(async () => {
const hasCamera = await QrScanner.hasCamera();
log.debug("detecting camera: ", hasCamera);
if (!hasCamera) {
return;
}
log.debug("Has camera to scan QR codes:", hasCamera);
setCamera(hasCamera);
});

Expand Down
5 changes: 0 additions & 5 deletions src/context/Global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ export type GlobalContextType = {
setNotificationType: Setter<string>;
webln: Accessor<boolean>;
setWebln: Setter<boolean>;
camera: Accessor<boolean>;
setCamera: Setter<boolean>;
ref: Accessor<string>;
setRef: Setter<string>;
i18nConfigured: Accessor<string | null>;
Expand Down Expand Up @@ -124,7 +122,6 @@ const GlobalProvider = (props: { children: JSX.Element }) => {
const [notificationType, setNotificationType] = createSignal<string>("");

const [webln, setWebln] = createSignal<boolean>(false);
const [camera, setCamera] = createSignal<boolean>(false);

const [embedded, setEmbedded] = createSignal<boolean>(false);

Expand Down Expand Up @@ -377,8 +374,6 @@ const GlobalProvider = (props: { children: JSX.Element }) => {
setNotificationType,
webln,
setWebln,
camera,
setCamera,
ref,
setRef,
i18nConfigured,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ const Create = () => {
</Show>
<InvoiceInput />
</Show>
<Show when={isMobile()}>
<Show when={isMobile() && assetReceive() !== RBTC}>
<QrScan />
</Show>
<CreateButton />
Expand Down
21 changes: 0 additions & 21 deletions tests/components/QrScan.spec.tsx

This file was deleted.

0 comments on commit fce87d1

Please sign in to comment.