Avoid storing audio and video file data in memory (#11974)
This commit is contained in:
		
							parent
							
								
									05ad7d606c
								
							
						
					
					
						commit
						860a77d45e
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -107,7 +107,10 @@ function appendMedia(state, media, file) {
 | 
			
		|||
  const prevSize = state.get('media_attachments').size;
 | 
			
		||||
 | 
			
		||||
  return state.withMutations(map => {
 | 
			
		||||
    map.update('media_attachments', list => list.push(media.set('file', file)));
 | 
			
		||||
    if (media.get('type') === 'image') {
 | 
			
		||||
      media = media.set('file', file);
 | 
			
		||||
    }
 | 
			
		||||
    map.update('media_attachments', list => list.push(media));
 | 
			
		||||
    map.set('is_uploading', false);
 | 
			
		||||
    map.set('resetFileKey', Math.floor((Math.random() * 0x10000)));
 | 
			
		||||
    map.set('idempotencyKey', uuid());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue