do not load ruffle multiple times!

This commit is contained in:
Henry Jameson 2021-04-12 01:15:59 +03:00
parent 6b250762f0
commit 87903fbf6d
1 changed files with 4 additions and 1 deletions

View File

@ -2,7 +2,10 @@ const createRuffleService = () => {
let ruffleInstance = null
const getRuffle = () => new Promise((resolve, reject) => {
if (ruffleInstance) resolve(ruffleInstance)
if (ruffleInstance) {
resolve(ruffleInstance)
return
}
// Ruffle needs these to be set before it's loaded
// https://github.com/ruffle-rs/ruffle/issues/3952
window.RufflePlayer = {}