fix: properly handle unresolved media

This commit is contained in:
Pedro Lopez
2020-03-15 15:29:56 -04:00
parent 5934ec531f
commit 25b96378c7

View File

@@ -186,7 +186,7 @@ class Message extends Base {
return undefined;
}
const {data, mimetype, filename} = await this.client.pupPage.evaluate(async (msgId) => {
const result = await this.client.pupPage.evaluate(async (msgId) => {
const msg = window.Store.Msg.get(msgId);
if(msg.mediaData.mediaStage != 'RESOLVED') {
@@ -211,7 +211,8 @@ class Message extends Base {
}, this.id._serialized);
return new MessageMedia(mimetype, data, filename);
if(!result) return undefined;
return new MessageMedia(result.mimetype, result.data, result.filename);
}
/**