flash
cf71bab92d
This has been in the works for over a month and might break things because it's a very radical change. If it causes you to be unable to join chat, report it on the forum or try joining using the legacy chat on https://sockchat.flashii.net.
20 lines
558 B
JavaScript
20 lines
558 B
JavaScript
const MamiSleep = durationMs => new Promise(resolve => { setTimeout(resolve, durationMs); });
|
|
|
|
const MamiWaitVisible = () => {
|
|
return new Promise(resolve => {
|
|
if(document.visibilityState === 'visible') {
|
|
resolve();
|
|
return;
|
|
}
|
|
|
|
const handler = () => {
|
|
if(document.visibilityState === 'visible') {
|
|
window.removeEventListener('visibilitychange', handler);
|
|
resolve();
|
|
}
|
|
};
|
|
|
|
window.addEventListener('visibilitychange', handler);
|
|
});
|
|
};
|