Files
discord-decomp/modules/status_bar/native/components/StatusBarManager.android.tsx
T
2026-11-01 12:12:55 +02:00

60 lines
1.5 KiB
TypeScript

// Metro module 6680 (f6681).
import { StatusBar } from "react-native";
import Module12 from "../../../../_bundle/Module12";
import Module1593 from "../../../../_bundle/Module1593";
class StatusBarManager {
constructor() {
return {
__proto__: new.target.prototype,
propsStack: [],
updateImmediate: null
};
}
pushStackEntry(a0) {
const r0 = {
hidden: a0.hidden,
barStyle: a0.barStyle
};
this.propsStack.push(r0);
this.updatePropsStack();
return r0;
}
popStackEntry(a0) {
const r5 = a0 != null ? this.propsStack.indexOf(a0) : -1;
if (r5 !== -1) {
this.propsStack.splice(r5, 1);
this.updatePropsStack();
}
}
replaceStackEntry(a0, a1) {
const r2 = {
hidden: a1.hidden,
barStyle: a1.barStyle
};
const r10 = a0 != null ? this.propsStack.indexOf(a0) : -1;
if (r10 !== -1) {
this.propsStack[r10] = r2;
}
this.updatePropsStack();
return r2;
}
updatePropsStack() {
clearImmediate(this.updateImmediate);
this.updateImmediate = setImmediate(() => {
const r19 = Module12.merge.apply(Module12, [{
hidden: false,
barStyle: "default"
}, ...this.propsStack]);
const { barStyle, hidden } = r19;
StatusBar.setBarStyle(barStyle);
Module1593.setStatusBarVisible(!hidden);
});
}
}
const r28 = {
__proto__: StatusBarManager.prototype,
propsStack: [],
updateImmediate: null
};
export default r28;