Refactor resizeImage method (#7236)
- Use URL.createObjectURL (replace from FileReader) - Use HTMLCanvasElement.prototype.toBlob (replace from HTMLCanvasElement.prototype.toDataURL) - Use Promise (replace callback interface)
This commit is contained in:
		
					parent
					
						
							
								660cb058e1
							
						
					
				
			
			
				commit
				
					
						0758b00bfd
					
				
			
		
					 7 changed files with 120 additions and 95 deletions
				
			
		
							
								
								
									
										10
									
								
								app/javascript/mastodon/utils/__tests__/base64-test.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								app/javascript/mastodon/utils/__tests__/base64-test.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,10 @@ | |||
| import * as base64 from '../base64'; | ||||
| 
 | ||||
| describe('base64', () => { | ||||
|   describe('decode', () => { | ||||
|     it('returns a uint8 array', () => { | ||||
|       const arr = base64.decode('dGVzdA=='); | ||||
|       expect(arr).toEqual(new Uint8Array([116, 101, 115, 116])); | ||||
|     }); | ||||
|   }); | ||||
| }); | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue