chore: fix never resolve promise when downloading expired media (#4012)

Co-authored-by: fallenleavesguy <no@email.com>
This commit is contained in:
fallenleavesbuy 2025-12-13 12:19:10 +08:00 • committed by GitHub
commit dec1bee842
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -449,7 +449,9 @@ class Message extends Base {
const result = await this.client.pupPage.evaluate(async (msgId) => { const result = await this.client.pupPage.evaluate(async (msgId) => {
const msg = window.Store.Msg.get(msgId) || (await window.Store.Msg.getMessagesById([msgId]))?.messages?.[0]; const msg = window.Store.Msg.get(msgId) || (await window.Store.Msg.getMessagesById([msgId]))?.messages?.[0];
if (!msg || !msg.mediaData) {
// REUPLOADING mediaStage means the media is expired and the download button is spinning, cannot be downloaded now
if (!msg || !msg.mediaData || msg.mediaData.mediaStage === 'REUPLOADING') {
return null; return null;
} }
if (msg.mediaData.mediaStage != 'RESOLVED') { if (msg.mediaData.mediaStage != 'RESOLVED') {