Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/web/lib/components/vton/VtonModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ export function VtonModal() {
}, [backgroundJob?.status]);

// Abort on unmount
useEffect(
() => () => {
useEffect(() => {
mountedRef.current = true;
return () => {
mountedRef.current = false;
fileSelectRequestIdRef.current += 1;
abortControllerRef.current?.abort();
},
[]
);
};
}, []);

const {
handleTryOn,
Expand Down
4 changes: 2 additions & 2 deletions packages/web/lib/components/vton/VtonPhotoArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ export function VtonPhotoArea({
setConsentOpen(true);
};

const handleConsentAccept = async () => {
const handleConsentAccept = () => {
const intent = pendingIntent;
await persistVtonPhotoConsent(undefined, {
void persistVtonPhotoConsent(undefined, {
policySnapshot: {
source: "vton_modal",
locale:
Expand Down
9 changes: 4 additions & 5 deletions packages/web/lib/components/vton/__tests__/VtonLab.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* @vitest-environment jsdom */

import { StrictMode } from "react";
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { VtonLab } from "../VtonLab";
Expand Down Expand Up @@ -223,9 +224,7 @@ describe("VtonLab", () => {
expect(localStorage.getItem(VTON_PHOTO_CONSENT_KEY)).toContain(
'"version":"v1"'
);
await waitFor(() => {
expect(inputClickSpy).toHaveBeenCalledTimes(1);
});
expect(inputClickSpy).toHaveBeenCalledTimes(1);
});

it("gates Gallery through consent and leaves the VTON modal open when declined", async () => {
Expand Down Expand Up @@ -491,10 +490,10 @@ describe("VtonLab", () => {
});

const { container } = render(
<>
<StrictMode>
<VtonLab />
<VtonModal />
</>
</StrictMode>
);

await waitFor(() => {
Expand Down
Loading