Catch export error if dictionary has no words.
This commit is contained in:
parent
d7f1f2f1be
commit
06281fccac
|
@ -574,11 +574,15 @@ function SavePreviousDictionary () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function ExportDictionary() {
|
function ExportDictionary() {
|
||||||
var downloadName = removeDiacritics(stripHtmlEntities(currentDictionary.name)).replace(/\W/g, '');
|
if (currentDictionary.words.length > 0) {
|
||||||
if (downloadName == "") {
|
var downloadName = removeDiacritics(stripHtmlEntities(currentDictionary.name)).replace(/\W/g, '');
|
||||||
downloadName = "export";
|
if (downloadName == "") {
|
||||||
|
downloadName = "export";
|
||||||
|
}
|
||||||
|
download(downloadName + ".dict", localStorage.getItem('dictionary'));
|
||||||
|
} else {
|
||||||
|
alert("Dictionary must have at least 1 word to export.")
|
||||||
}
|
}
|
||||||
download(downloadName + ".dict", localStorage.getItem('dictionary'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ImportDictionary() {
|
function ImportDictionary() {
|
||||||
|
|
Loading…
Reference in New Issue