Ensure outgoing attachment size always matches resized image
This commit is contained in:
parent
2c3847affe
commit
1b9959aca3
1 changed files with 3 additions and 1 deletions
|
@ -523,9 +523,11 @@
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const FR = new FileReader();
|
const FR = new FileReader();
|
||||||
FR.onload = e => {
|
FR.onload = e => {
|
||||||
|
const data = e.target.result;
|
||||||
resolve({
|
resolve({
|
||||||
...attachment,
|
...attachment,
|
||||||
data: e.target.result,
|
data,
|
||||||
|
size: data.byteLength,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
FR.onerror = reject;
|
FR.onerror = reject;
|
||||||
|
|
Loading…
Add table
Reference in a new issue