From 22918a8d72ab19cc09be88dcb6e22eea088dc1c9 Mon Sep 17 00:00:00 2001 From: Triston Armstrong Date: Mon, 7 Oct 2024 03:08:56 -0400 Subject: [PATCH] chore/limit what file types can be added --- src/components/cardSelector/ImageCardButton.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/cardSelector/ImageCardButton.tsx b/src/components/cardSelector/ImageCardButton.tsx index 018d354..45a5b2d 100644 --- a/src/components/cardSelector/ImageCardButton.tsx +++ b/src/components/cardSelector/ImageCardButton.tsx @@ -8,6 +8,9 @@ export function ImageCardButton() { function _handleClick(mouseEvent: MouseEvent) { const input = document.createElement('input') input.type = 'file' + input.accept = ".png,.jpg,.webp,.jpeg" + input.multiple = false + input.onchange = (e: any) => { const file = e.target.files[0] const reader = new FileReader()