feat: alert the user on empty collection/environment exports (#3416)

This commit is contained in:
James George
2023-10-05 02:08:38 -07:00
committed by GitHub
parent 87d617012f
commit ae89af9978
4 changed files with 22 additions and 0 deletions

View File

@@ -377,6 +377,13 @@ const importFromPostman = ({
const exportJSON = () => {
const dataToWrite = environmentJson.value
const parsedCollections = JSON.parse(dataToWrite)
if (!parsedCollections.length) {
return toast.error(t("error.no_environments_to_export"))
}
const file = new Blob([dataToWrite], { type: "application/json" })
const a = document.createElement("a")
const url = URL.createObjectURL(file)