Fixed error during chat startup.

This commit is contained in:
flash 2024-02-10 23:20:30 +00:00
parent 85a9fd2422
commit d3ec2e2c58
2 changed files with 4 additions and 4 deletions

View file

@ -185,7 +185,7 @@ window.Umi = { UI: {}, Protocol: { SockChat: { Protocol: {} } } };
if(!settings.get('tmpSkipDomainPopUpThing')) if(!settings.get('tmpSkipDomainPopUpThing'))
await (() => { await (() => {
return new Promise((resolve) => { return new Promise((resolve) => {
views.push(new MamiDomainTransition(() => { views.push(new MamiDomainTransition(soundCtx.library, () => {
(new MamiSettingsBackup(settings)).importUpload(document.body); (new MamiSettingsBackup(settings)).importUpload(document.body);
}, () => { }, () => {
settings.set('tmpSkipDomainPopUpThing', true); settings.set('tmpSkipDomainPopUpThing', true);

View file

@ -1,7 +1,7 @@
#include common.js #include common.js
#include rng.js #include rng.js
const MamiDomainTransition = function(onImport, onDismiss) { const MamiDomainTransition = function(soundLib, onImport, onDismiss) {
if(typeof onImport !== 'function') if(typeof onImport !== 'function')
throw 'onImport must be a function'; throw 'onImport must be a function';
if(typeof onDismiss !== 'function') if(typeof onDismiss !== 'function')
@ -56,8 +56,8 @@ const MamiDomainTransition = function(onImport, onDismiss) {
</div>; </div>;
const soundRNG = new MamiRNG(); const soundRNG = new MamiRNG();
const soundNames = mami.sound.library.names(); const soundNames = soundLib.names();
const playRandomSound = () => mami.sound.library.play(soundNames[soundRNG.next(soundNames.length)]); const playRandomSound = () => soundLib.play(soundNames[soundRNG.next(soundNames.length)]);
for(let i = 0; i < 10; ++i) for(let i = 0; i < 10; ++i)
eggsTarget.appendChild(<i class="fas fa-egg fa-3x" onclick={() => playRandomSound()} />); eggsTarget.appendChild(<i class="fas fa-egg fa-3x" onclick={() => playRandomSound()} />);