Merge pull request #1922 from PR0M3TH3AN/fix-webtorrent-race-and-profile-media-10857751696116358785

Fix WebTorrent race condition and legacy media warning
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-01-29 09:17:57 -05:00
commit 708c46f72f
2 files changed
+9

No files matched your search

+4
View File
@@ -46,6 +46,10 @@ export function sanitizeProfileMediaUrl(value) {
return trimmed;
}
if (trimmed === "images/robot.png") {
return "";
}
if (/^ipfs:\/\//i.test(trimmed)) {
return normalizeIpfsGatewayUrl(trimmed);
}
+5
View File
@@ -873,6 +873,11 @@ export class TorrentClient {
emit("torrent-stream-start", { magnet: magnetURI });
// 1) Make sure we have a WebTorrent client and a valid SW registration.
const initResult = await this.init();
if (!this.client) {
throw new Error("Client destroyed during initialization");
}
const serviceWorkerReady =
!!(initResult?.serviceWorkerReady && this.swRegistration);