chore/limit what file types can be added

This commit is contained in:
Triston Armstrong 2024-10-07 03:08:56 -04:00
parent f67649b6b7
commit 22918a8d72
Signed by: tristonarmstrong
GPG Key ID: A23B48AE45EB6EFE

View File

@ -8,6 +8,9 @@ export function ImageCardButton() {
function _handleClick(mouseEvent: MouseEvent) { function _handleClick(mouseEvent: MouseEvent) {
const input = document.createElement('input') const input = document.createElement('input')
input.type = 'file' input.type = 'file'
input.accept = ".png,.jpg,.webp,.jpeg"
input.multiple = false
input.onchange = (e: any) => { input.onchange = (e: any) => {
const file = e.target.files[0] const file = e.target.files[0]
const reader = new FileReader() const reader = new FileReader()