Skip to content

Commit

Permalink
fix: uploaded file data stays even after import
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Dec 30, 2024
1 parent ac368f0 commit 3732642
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions frontend/src2/data_source/UploadCSVFileDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function importCSVData() {
})
.then(() => {
show.value = false
resetFile()
createToast({
title: 'Table Imported',
message: `Table '${csvData.tablename}' imported successfully`,
Expand All @@ -60,6 +61,15 @@ function importCSVData() {
importing.value = false
})
}
function resetFile() {
fileUploaded.value = false
csvData.file = null
csvData.tablename = ''
csvData.columns = []
csvData.rows = []
csvData.totalRowCount = 0
}
</script>

<template>
Expand Down Expand Up @@ -130,6 +140,7 @@ function importCSVData() {
</div>
<div class="mt-4 flex justify-between pt-2">
<div class="ml-auto flex items-center space-x-2">
<Button :disabled="!fileUploaded" @click="resetFile"> Reset File </Button>
<Button
variant="solid"
:disabled="importDisabled"
Expand Down

0 comments on commit 3732642

Please sign in to comment.