From 87903fbf6dd8fbc47fe5a49b901aa295e07529e8 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 12 Apr 2021 01:15:59 +0300 Subject: [PATCH] do not load ruffle multiple times! --- src/services/ruffle_service/ruffle_service.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/ruffle_service/ruffle_service.js b/src/services/ruffle_service/ruffle_service.js index 61fe1e19..7411dd96 100644 --- a/src/services/ruffle_service/ruffle_service.js +++ b/src/services/ruffle_service/ruffle_service.js @@ -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 = {}