Remove incorrect Discord SDK loading script from HTML - SDK is imported properly in React context
cgen-d64ba6b866c94c7eb212a61c2c33c75f
This commit is contained in:
parent
92ed0f7a09
commit
631bee58b8
1 changed files with 1 additions and 25 deletions
26
index.html
26
index.html
|
|
@ -184,31 +184,7 @@
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Discord SDK for Activities (loaded only in /discord context) -->
|
<!-- Discord SDK is imported in DiscordActivityContext.tsx from @discord/embedded-app-sdk npm package -->
|
||||||
<script>
|
|
||||||
window.discordSdkReady = false;
|
|
||||||
|
|
||||||
// Only attempt to load Discord SDK if we're in the Discord Activity route
|
|
||||||
window.loadDiscordSDK = async function () {
|
|
||||||
if (window.discordSdkReady) return;
|
|
||||||
try {
|
|
||||||
const { DiscordSDK } = await import(
|
|
||||||
"https://cdn.discordapp.com/assets/embedded/lazyload.min.js"
|
|
||||||
);
|
|
||||||
if (DiscordSDK) {
|
|
||||||
window.DiscordSDK = new DiscordSDK({
|
|
||||||
clientId: "578971245454950421",
|
|
||||||
});
|
|
||||||
window.discordSdkReady = true;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.warn(
|
|
||||||
"Discord SDK loading skipped (not in Activity context):",
|
|
||||||
e.message,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue