fix: clean up Add Stamp image preview blob URLs (#6779)

Co-authored-by: James Brunton <jbrunton96@gmail.com>
This commit is contained in:
jayakrishna
2026-08-27 18:34:43 +01:00
committed by GitHub
co-authored by James Brunton
parent 97c0ccf582
commit 51835a7b5e
@@ -19,6 +19,7 @@ import { AddStampParameters } from "@app/components/tools/addStamp/useAddStampPa
import ButtonSelector from "@app/components/shared/ButtonSelector";
import styles from "@app/components/tools/addStamp/StampPreview.module.css";
import { getDefaultFontSizeForAlphabet } from "@app/components/tools/addStamp/StampPreviewUtils";
import { useFileWithUrl } from "@app/hooks/useFileWithUrl";
import { Z_INDEX_AUTOMATE_DROPDOWN } from "@app/styles/zIndex";
const STAMP_TEMPLATES = [
@@ -209,6 +210,9 @@ const StampSetupSettings = ({
filename,
}: StampSetupSettingsProps) => {
const { t } = useTranslation();
const stampImageWithUrl = useFileWithUrl(
parameters.stampType === "image" ? (parameters.stampImage ?? null) : null,
);
return (
<Stack gap="md">
@@ -679,10 +683,10 @@ const StampSetupSettings = ({
>
{t("chooseFile", "Choose File")}
</Button>
{parameters.stampImage && (
{parameters.stampImage && stampImageWithUrl && (
<Stack gap="xs">
<img
src={URL.createObjectURL(parameters.stampImage)}
src={stampImageWithUrl.url}
alt="Selected stamp image"
className="max-h-24 w-full object-contain border border-gray-200 rounded bg-gray-50"
/>