mirror of
				https://github.com/Alamantus/Lexiconga.git
				synced 2025-11-04 10:17:01 +01:00 
			
		
		
		
	Catch export error if dictionary has no words.
This commit is contained in:
		
							parent
							
								
									d7f1f2f1be
								
							
						
					
					
						commit
						06281fccac
					
				
					 1 changed files with 8 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -574,11 +574,15 @@ function SavePreviousDictionary () {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
function ExportDictionary() {
 | 
			
		||||
    if (currentDictionary.words.length > 0) {
 | 
			
		||||
        var downloadName = removeDiacritics(stripHtmlEntities(currentDictionary.name)).replace(/\W/g, '');
 | 
			
		||||
        if (downloadName == "") {
 | 
			
		||||
            downloadName = "export";
 | 
			
		||||
        }
 | 
			
		||||
        download(downloadName + ".dict", localStorage.getItem('dictionary'));
 | 
			
		||||
    } else {
 | 
			
		||||
        alert("Dictionary must have at least 1 word to export.")
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function ImportDictionary() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue