Files
discord-decomp/stores/CollapsedVoiceChannelStore.tsx
T
2026-11-01 12:12:55 +02:00

54 lines
1.4 KiB
TypeScript

// Metro module 5780 (f5781).
import ChannelStore from "./ChannelStore";
import SnowflakeUtils from "../utils/SnowflakeUtils";
import Module589 from "../_bundle/Module589";
import Dispatcher from "../Dispatcher";
let c3596_3, c3596_4;
const handleConnectionOpen = function handleConnectionOpen() {
SnowflakeUtils.keys(c3596_4).forEach((item) => {
if (ChannelStore.getChannel(item) == null) {
delete c3596_4[item];
}
});
};
c3596_3 = {};
c3596_4 = c3596_3;
class CollapsedVoiceChannelStore extends Module589.PersistedStore {
static displayName = "CollapsedVoiceChannelStore";
static persistKey = "collapsedChannels";
initialize(a0) {
let r1 = a0;
this.waitFor(ChannelStore);
if (a0 == null) {
r1 = c3596_3;
}
c3596_4 = r1;
}
getState() {
return c3596_4;
}
getCollapsed() {
return c3596_4;
}
isCollapsed(a0) {
return c3596_4[a0] || false;
}
}
const collapsedVoiceChannelStore = new CollapsedVoiceChannelStore(Dispatcher, {
CONNECTION_OPEN: handleConnectionOpen,
OVERLAY_INITIALIZE: handleConnectionOpen,
CHANNEL_COLLAPSE: function handleChannelCollapse({ channelId }) {
const r4 = c3596_4[channelId];
const r8 = c3596_4;
if (r4) {
delete r8[channelId];
} else {
r8[channelId] = true;
}
c3596_4 = {
...c3596_4
};
}
});
export default collapsedVoiceChannelStore;