Skip to content

Commit

Permalink
👽️ Fix file @change handler interface changes
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Dec 30, 2024
1 parent e54183a commit 94ac7b7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 35 deletions.
12 changes: 2 additions & 10 deletions pages/batch-qrcode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,8 @@ async function drawQRCodes () {
})
}
function handleFileChange (event: Event) {
if (!event?.target) {
return
}
const files = (event.target as HTMLInputElement)?.files
if (!files) {
return
}
function handleFileChange (files: FileList) {
if (!files) { return }
const [file] = files
const reader = new FileReader()
reader.onload = (e) => {
Expand Down
12 changes: 2 additions & 10 deletions pages/batch-short-links.vue
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,8 @@ function convertToQRCode () {
router.push({ name: 'batch-qrcode' })
}
function handleFileChange (event: Event) {
if (!event?.target) {
return
}
const files = (event.target as HTMLInputElement)?.files
if (!files) {
return
}
function handleFileChange (files: FileList) {
if (!files) { return }
const [file] = files
const reader = new FileReader()
reader.onload = (e) => {
Expand Down
16 changes: 4 additions & 12 deletions pages/mint-nft/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,7 @@ async function onISCNFileInput () {
}
}
function onISCNFileChange (event: Event) {
if (!event?.target) { return }
const files = (event.target as HTMLInputElement)?.files
function onISCNFileChange (files: FileList) {
if (!files) { return }
const [file] = files
const reader = new FileReader()
Expand Down Expand Up @@ -732,9 +730,7 @@ async function onClassFileInput () {
}
}
function onClassFileChange (event: Event) {
if (!event?.target) { return }
const files = (event.target as HTMLInputElement)?.files
function onClassFileChange (files: FileList) {
if (!files) { return }
const [file] = files
const reader = new FileReader()
Expand Down Expand Up @@ -813,9 +809,7 @@ async function onMintNFTStart () {
}
}
function onMintNFTDefaultFileChange (event: Event) {
if (!event?.target) { return }
const files = (event.target as HTMLInputElement)?.files
function onMintNFTDefaultFileChange (files: FileList) {
if (!files) { return }
const [file] = files
const reader = new FileReader()
Expand All @@ -834,9 +828,7 @@ function onMintNFTDefaultFileChange (event: Event) {
reader.readAsText(file)
}
function onMintNFTFileChange (event: Event) {
if (!event?.target) { return }
const files = (event.target as HTMLInputElement)?.files
function onMintNFTFileChange (files: FileList) {
if (!files) { return }
const [file] = files
const reader = new FileReader()
Expand Down
4 changes: 1 addition & 3 deletions pages/nft-book-store/gift/[classId].vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,7 @@ function downloadTemplateCSV () {
)
}
function onReceiverFileChange (event: Event) {
if (!event?.target) { return }
const files = (event.target as HTMLInputElement)?.files
function onReceiverFileChange (files: FileList) {
if (!files) { return }
const [file] = files
const reader = new FileReader()
Expand Down

0 comments on commit 94ac7b7

Please sign in to comment.