Fix: isWarm -> isTouched
This commit is contained in:
		
							parent
							
								
									6d411c01fc
								
							
						
					
					
						commit
						d93bf05f64
					
				| 
						 | 
				
			
			@ -1894,7 +1894,7 @@ chrome.runtime.onMessage.addListener(onRuntimeMessage);
 | 
			
		|||
 | 
			
		||||
function replaceStyle(request) {
 | 
			
		||||
  const codeIsUpdated = request.codeIsUpdated !== false;
 | 
			
		||||
  if (codeIsUpdated && editor && editor.isWarm() && !confirm(t('styleUpdateDiscardChanges'))) {
 | 
			
		||||
  if (codeIsUpdated && editor && editor.isTouched() && !confirm(t('styleUpdateDiscardChanges'))) {
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
  doReplace();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
'use strict';
 | 
			
		||||
 | 
			
		||||
function createSourceEditor(style) {
 | 
			
		||||
  // a flag for isWarm()
 | 
			
		||||
  // a flag for isTouched()
 | 
			
		||||
  let hadBeenSaved = false;
 | 
			
		||||
 | 
			
		||||
  // draw HTML
 | 
			
		||||
| 
						 | 
				
			
			@ -242,7 +242,7 @@ ${section}
 | 
			
		|||
      });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function isWarm() {
 | 
			
		||||
  function isTouched() {
 | 
			
		||||
    // indicate that the editor had been touched by the user
 | 
			
		||||
    return dirty.isDirty() || hadBeenSaved;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -260,6 +260,6 @@ ${section}
 | 
			
		|||
    toggleStyle,
 | 
			
		||||
    isDirty: dirty.isDirty,
 | 
			
		||||
    getStyle: () => style,
 | 
			
		||||
    isWarm
 | 
			
		||||
    isTouched
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user