don't rewrite if already converted (#875)
This commit is contained in:
		@@ -434,6 +434,10 @@ namespace pxt.editor {
 | 
			
		||||
            .concat(U.toArray(dom.querySelectorAll("block[type=device_build_image]")))
 | 
			
		||||
            .concat(U.toArray(dom.querySelectorAll("block[type=device_build_big_image]")))
 | 
			
		||||
        nodes.forEach(node => {            
 | 
			
		||||
            // don't rewrite if already upgraded, eg. field LEDS already present
 | 
			
		||||
            if (U.toArray(node.children).filter(child => child.tagName == "field" && "LEDS" == child.getAttribute("name"))[0])
 | 
			
		||||
                return;
 | 
			
		||||
            // read LEDxx value and assmebly into a new field
 | 
			
		||||
            const leds: string[][] = [[], [], [], [], []];
 | 
			
		||||
            U.toArray(node.children)
 | 
			
		||||
                .filter(child => child.tagName == "field" && /^LED\d+$/.test(child.getAttribute("name")))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user