From d3ec2e2c582db174784b6e358686b09bab504e13 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sat, 10 Feb 2024 23:20:30 +0000 Subject: [PATCH] Fixed error during chat startup. --- src/mami.js/main.js | 2 +- src/mami.js/ui/domaintrans.jsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mami.js/main.js b/src/mami.js/main.js index a427803..1bf1ea0 100644 --- a/src/mami.js/main.js +++ b/src/mami.js/main.js @@ -185,7 +185,7 @@ window.Umi = { UI: {}, Protocol: { SockChat: { Protocol: {} } } }; if(!settings.get('tmpSkipDomainPopUpThing')) await (() => { return new Promise((resolve) => { - views.push(new MamiDomainTransition(() => { + views.push(new MamiDomainTransition(soundCtx.library, () => { (new MamiSettingsBackup(settings)).importUpload(document.body); }, () => { settings.set('tmpSkipDomainPopUpThing', true); diff --git a/src/mami.js/ui/domaintrans.jsx b/src/mami.js/ui/domaintrans.jsx index dc9440a..44fa8a6 100644 --- a/src/mami.js/ui/domaintrans.jsx +++ b/src/mami.js/ui/domaintrans.jsx @@ -1,7 +1,7 @@ #include common.js #include rng.js -const MamiDomainTransition = function(onImport, onDismiss) { +const MamiDomainTransition = function(soundLib, onImport, onDismiss) { if(typeof onImport !== 'function') throw 'onImport must be a function'; if(typeof onDismiss !== 'function') @@ -56,8 +56,8 @@ const MamiDomainTransition = function(onImport, onDismiss) { ; const soundRNG = new MamiRNG(); - const soundNames = mami.sound.library.names(); - const playRandomSound = () => mami.sound.library.play(soundNames[soundRNG.next(soundNames.length)]); + const soundNames = soundLib.names(); + const playRandomSound = () => soundLib.play(soundNames[soundRNG.next(soundNames.length)]); for(let i = 0; i < 10; ++i) eggsTarget.appendChild( playRandomSound()} />);