Skip to content

Commit

Permalink
Media: Prepare media connection on load (#4596)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajaxy committed May 17, 2024
1 parent 6652e9c commit 4552a16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/gramjs/client/TelegramClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ class TelegramClient {
}
this._connectedDeferred.resolve();
this._isSwitchingDc = false;

// Prepare file connection on current DC to speed up initial media loading
const mediaSender = await this._borrowExportedSender(this.session.dcId, false, undefined, 0, this.isPremium);
if (mediaSender) this.releaseExportedSender(mediaSender);
}

async _initSession() {
Expand Down

0 comments on commit 4552a16

Please sign in to comment.