[Glitch] Avoid storing audio and video file data in memory
Port 860a77d45e
to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
parent
74af56b9cd
commit
0349c4d1cf
|
@ -194,7 +194,10 @@ function appendMedia(state, media, file) {
|
||||||
const prevSize = state.get('media_attachments').size;
|
const prevSize = state.get('media_attachments').size;
|
||||||
|
|
||||||
return state.withMutations(map => {
|
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('is_uploading', false);
|
||||||
map.set('resetFileKey', Math.floor((Math.random() * 0x10000)));
|
map.set('resetFileKey', Math.floor((Math.random() * 0x10000)));
|
||||||
map.set('idempotencyKey', uuid());
|
map.set('idempotencyKey', uuid());
|
||||||
|
|
Loading…
Reference in New Issue