diff --git a/packages/hoppscotch-app/components/collections/ImportExport.vue b/packages/hoppscotch-app/components/collections/ImportExport.vue index 4dae3351d..2859c8fff 100644 --- a/packages/hoppscotch-app/components/collections/ImportExport.vue +++ b/packages/hoppscotch-app/components/collections/ImportExport.vue @@ -13,25 +13,10 @@ svg="arrow-left" @click.native="resetImport" /> - - -
-
- -
-
- - @@ -312,28 +280,28 @@ const hideModal = () => { const stepResults = ref([]) -const importFromMyCollections = () => { - if (props.collectionsType.type !== "team-collections") return +// const importFromMyCollections = () => { +// if (props.collectionsType.type !== "team-collections") return - teamUtils - .importFromMyCollections( - apolloClient, - mySelectedCollectionID.value, - props.collectionsType.selectedTeam.id - ) - .then((success) => { - if (success) { - fileImported() - emit("update-team-collections") - } else { - failedImport() - } - }) - .catch((e) => { - console.error(e) - failedImport() - }) -} +// teamUtils +// .importFromMyCollections( +// apolloClient, +// mySelectedCollectionID.value, +// props.collectionsType.selectedTeam.id +// ) +// .then((success) => { +// if (success) { +// fileImported() +// emit("update-team-collections") +// } else { +// failedImport() +// } +// }) +// .catch((e) => { +// console.error(e) +// failedImport() +// }) +// } const exportJSON = () => { getJSONCollection() @@ -402,13 +370,17 @@ watch(inputChooseGistToImportFrom, (v) => { }) const onFileChange = () => { - if (!inputChooseFileToImportFrom.value[0]) return + if (!inputChooseFileToImportFrom.value[0]) { + hasFile.value = false + return + } if ( !inputChooseFileToImportFrom.value[0].files || inputChooseFileToImportFrom.value[0].files.length === 0 ) { inputChooseFileToImportFrom.value[0].value = "" + hasFile.value = false toast.show(t("action.choose_file").toString()) return } @@ -419,6 +391,7 @@ const onFileChange = () => { reader.onload = ({ target }) => { const content = target!.result as string | null if (!content) { + hasFile.value = false toast.show(t("action.choose_file").toString()) return } @@ -440,5 +413,6 @@ const resetImport = () => { hasFile.value = false inputChooseGistToImportFrom.value = "" hasGist.value = false + mySelectedCollectionID.value = undefined }