();
const { syncActionIfEnabled } = useAddCallbacks();
const cheatsFormId = useId();
@@ -52,8 +44,8 @@ export const UploadCheatsModal = () => {
)
);
- reset();
- syncActionIfEnabled();
+ await syncActionIfEnabled();
+ setIsModalOpen(false);
};
const tourSteps: TourSteps = [
@@ -101,7 +93,6 @@ export const UploadCheatsModal = () => {
validFileExtensions={validFileExtensions}
error={error?.message}
hideAcceptedFiles={!value?.length}
- hideErrors={isSubmitSuccessful}
multiple
>
@@ -112,20 +103,12 @@ export const UploadCheatsModal = () => {
)}
/>
- {isSubmitSuccessful && (
-
- Upload complete!
-
- )}
-
+
diff --git a/gbajs3/src/components/modals/upload-public-external-roms.spec.tsx b/gbajs3/src/components/modals/upload-public-external-roms.spec.tsx
index 8d18abd2..1132bdda 100644
--- a/gbajs3/src/components/modals/upload-public-external-roms.spec.tsx
+++ b/gbajs3/src/components/modals/upload-public-external-roms.spec.tsx
@@ -84,8 +84,6 @@ describe('', () => {
expect(onLoadOrDismissSpy).toHaveBeenCalledOnce();
expect(onLoadOrDismissSpy).toHaveBeenCalledWith('loaded');
expect(setIsModalOpenSpy).toHaveBeenCalledWith(false);
-
- expect(await screen.findByText('Upload complete!')).toBeVisible();
});
it('renders external rom error', async () => {
diff --git a/gbajs3/src/components/modals/upload-public-external-roms.tsx b/gbajs3/src/components/modals/upload-public-external-roms.tsx
index ee911745..9249897d 100644
--- a/gbajs3/src/components/modals/upload-public-external-roms.tsx
+++ b/gbajs3/src/components/modals/upload-public-external-roms.tsx
@@ -21,7 +21,6 @@ import {
LoadingIndicator,
PacmanIndicator
} from '../shared/loading-indicator.tsx';
-import { CenteredTextContainer } from '../shared/styled.tsx';
import type { PublicRomUploadStatus } from '../../hooks/use-show-load-public-roms.tsx';
@@ -60,7 +59,6 @@ export const UploadPublicExternalRomsModal = ({
const theme = useTheme();
const { setIsModalOpen } = useModalContext();
const { emulator } = useEmulatorContext();
- const [hasCompletedUpload, setHasCompletedUpload] = useState(false);
const [currentRomURL, setCurrentRomURL] = useState(null);
const uploadRomButtonId = useId();
const runGame = useRunGame();
@@ -87,7 +85,6 @@ export const UploadPublicExternalRomsModal = ({
};
emulator?.uploadRom(externalRomFile, runCallback);
setCurrentRomURL(null);
- setHasCompletedUpload(true);
}
}, [
onLoadOrDismiss,
@@ -113,13 +110,9 @@ export const UploadPublicExternalRomsModal = ({
indicator={}
loadingCopy="Loading rom from url:"
>
- {!hasCompletedUpload && (
- <>
- A public rom URL has been shared with you.
- You can load it using the upload button!
- Make sure you trust the provider before uploading:
- >
- )}
+ A public rom URL has been shared with you.
+ You can load it using the upload button!
+ Make sure you trust the provider before uploading:
{!!externalRomLoadError && (
)}
- {hasCompletedUpload && (
-
- Upload complete!
-
- )}