mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 15:06:15 -04:00
fix: process stops if image preview or thumbnail creation fails
This commit is contained in:
parent
a0ba46caf4
commit
671dfa1c87
2 changed files with 8 additions and 5 deletions
|
@ -516,10 +516,12 @@ class ReceiveFileDialog extends ReceiveDialog {
|
|||
element.src = URL.createObjectURL(file);
|
||||
element.controls = true;
|
||||
element.classList.add('element-preview');
|
||||
this.$previewBox.appendChild(element)
|
||||
element.onload = _ => resolve(true);
|
||||
element.onload = _ => {
|
||||
this.$previewBox.appendChild(element);
|
||||
resolve(true)
|
||||
};
|
||||
element.addEventListener('loadeddata', _ => resolve(true));
|
||||
element.onerror = _ => reject(`${mime} preview could not be loaded`);
|
||||
element.onerror = _ => reject(`${mime} preview could not be loaded from type ${file.type}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue