Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5051.js (118.4 MB)
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
// Module ID: 15461
|
|
// Function ID: 15462
|
|
// Name: useCheckpointMusic
|
|
// Dependencies: [19, 17, 15454, 504, 9558, 15462, 2]
|
|
// Exports: default
|
|
|
|
// Module 15461 (useCheckpointMusic)
|
|
import _mod17 from "module_17" /* 17 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import CheckpointStore from "CheckpointStore" /* 15454 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
({ useEffect: c3, useRef: closure_4 } = noop);
|
|
const AppState = _mod17.AppState;
|
|
const result = size.fileFinishedImporting("modules/checkpoint/native/useCheckpointMusic.tsx");
|
|
|
|
export default function useCheckpointMusic() {
|
|
const items = [CheckpointStore];
|
|
stateFromStores = stateFromStores(504).useStateFromStores(items, () => CheckpointStore.isMuted);
|
|
closure_4(null);
|
|
closure_3(() => {
|
|
let num = 1;
|
|
const obj = stateFromStores(9558);
|
|
if (CheckpointStore.isMuted) {
|
|
num = 0;
|
|
}
|
|
const sound = obj.createSound(ref(15462), "vibing_wumpus", num);
|
|
ref.current = sound;
|
|
sound.loop();
|
|
ref = AppState.addEventListener("change", (event) => {
|
|
if ("active" === event) {
|
|
sound.play();
|
|
} else {
|
|
sound.pause();
|
|
}
|
|
});
|
|
return () => {
|
|
closure_1.remove();
|
|
sound.stop();
|
|
closure_1.current = null;
|
|
};
|
|
}, []);
|
|
const items1 = [stateFromStores];
|
|
closure_3(() => {
|
|
if (null != ref.current) {
|
|
let num = 1;
|
|
if (stateFromStores) {
|
|
num = 0;
|
|
}
|
|
ref.current.volume = num;
|
|
}
|
|
}, items1);
|
|
};
|