mirror of
				https://github.com/Alamantus/Lexiconga.git
				synced 2025-11-04 02:07:05 +01:00 
			
		
		
		
	Confirm migration if imported from http
This commit is contained in:
		
							parent
							
								
									e309ce1fb4
								
							
						
					
					
						commit
						8b1462f465
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -64,11 +64,14 @@ function dictionaryIsOldDefault(dictionaryJSON) {
 | 
			
		|||
 | 
			
		||||
function checkForReceived() {
 | 
			
		||||
  if (window.hasOwnProperty('dictionaryImportedFromHTTP')) {
 | 
			
		||||
    let saveOld = true;
 | 
			
		||||
    const storedDictionary = window.localStorage.getItem(LOCAL_STORAGE_KEY);
 | 
			
		||||
    if (!storedDictionary) {
 | 
			
		||||
    if (storedDictionary) {
 | 
			
		||||
      saveOld = confirm('You have an old local dictionary to import. Would you like to overwrite your current local dictionary?');
 | 
			
		||||
    }
 | 
			
		||||
    if (saveOld) {
 | 
			
		||||
      window.localStorage.setItem(LOCAL_STORAGE_KEY, window.dictionaryImportedFromHTTP);
 | 
			
		||||
      delete window.dictionaryImportedFromHTTP;
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		
		Reference in a new issue