diff --git a/src-web/components/ImportCurlButton.tsx b/src-web/components/ImportCurlButton.tsx index 1c640c35..6335cd84 100644 --- a/src-web/components/ImportCurlButton.tsx +++ b/src-web/components/ImportCurlButton.tsx @@ -1,7 +1,6 @@ import { clear, readText } from '@tauri-apps/plugin-clipboard-manager'; import * as m from 'motion/react-m'; import { useEffect, useState } from 'react'; -import { fireAndForget } from '../lib/fireAndForget'; import { useImportCurl } from '../hooks/useImportCurl'; import { useWindowFocus } from '../hooks/useWindowFocus'; import { Button } from './core/Button'; @@ -16,7 +15,7 @@ export function ImportCurlButton() { // oxlint-disable-next-line react-hooks/exhaustive-deps useEffect(() => { - fireAndForget(readText().then(setClipboardText)); + readText().then(setClipboardText).catch(() => {}); }, [focused]); if (!clipboardText?.trim().startsWith('curl ')) { diff --git a/src-web/components/responseViewers/PdfViewer.tsx b/src-web/components/responseViewers/PdfViewer.tsx index 7b0b236a..81bee9b3 100644 --- a/src-web/components/responseViewers/PdfViewer.tsx +++ b/src-web/components/responseViewers/PdfViewer.tsx @@ -57,7 +57,7 @@ export function PdfViewer({ bodyPath, data }: Props) { externalLinkTarget="_blank" externalLinkRel="noopener noreferrer" > - {Array.from({ length: numPages }, (_, index) => ( + {Array.from({ length: numPages ?? 0 }, (_, index) => (