Skip to content

Commit 637edb8

Browse files
committed
feat: improve error message
1 parent 4ca0831 commit 637edb8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/features/modals/DownloadModal/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@ export const DownloadModal = ({ opened, onClose }: ModalProps) => {
9292
toast.success("Copied to clipboard");
9393
gaEvent("clipboard_img");
9494
} catch (error) {
95-
toast.error("Failed to copy to clipboard");
95+
if (error instanceof Error && error.name === "NotAllowedError") {
96+
toast.error(
97+
"Clipboard write permission denied. Please allow clipboard access in your browser settings."
98+
);
99+
} else {
100+
toast.error("Failed to copy to clipboard");
101+
}
96102
} finally {
97103
toast.dismiss("toastClipboard");
98104
onClose();

0 commit comments

Comments
 (0)