Files
discord-decomp/modules/action_sheet/native/ActionSheetStore.tsx
T
2026-11-01 12:12:55 +02:00

118 lines
3.6 KiB
TypeScript

// Metro module 3882 (f3883).
import Module589 from "../../../_bundle/Module589";
import Dispatcher from "../../../Dispatcher";
function $mk73177($env) {
return (a0) => a0.key !== $env[0];
}
let zIndex;
let c2205_0 = new Array();
zIndex = void 0;
const key = "QuickSwitcher";
const setContent = (a0) => {};
class ActionSheetStore extends Module589.Store {
static displayName = "ActionSheetStore";
getContent = () => c2205_0.at(-1)?.content;
getStack = () => c2205_0;
isOpen = () => c2205_0.length > 0;
getKey = () => c2205_0.at(-1)?.key;
initialize() {}
get impressionName() {
return c2205_0.at(-1)?.impressionName;
}
get impressionProperties() {
return c2205_0.at(-1)?.impressionProperties;
}
get backdropKind() {
return c2205_0.at(-1)?.backdropKind;
}
}
const actionSheetStore = new ActionSheetStore(Dispatcher, {
SHOW_ACTION_SHEET: function handleShowActionSheet({ content, key: key2, impressionName: impressionName2, impressionProperties: impressionProperties2, backdropKind: backdropKind2, stackingBehavior = "replaceTopSheet", appEntryKey: appEntryKey2 = "main" }) {
let r29;
L13: {
const r7 = {
content,
key: key2,
impressionName: impressionName2,
impressionProperties: impressionProperties2,
backdropKind: backdropKind2,
appEntryKey: appEntryKey2,
zIndex
};
const r2 = c2205_0.length < 3;
if (stackingBehavior === "replaceAll") {
r29 = [r7];
} else {
if (stackingBehavior === "stack" && r2) {
r29 = [...c2205_0, r7];
break L13;
}
r29 = c2205_0.slice(0, -1).concat(r7);
}
}
c2205_0 = r29;
},
SHOW_ACTION_SHEET_QUICK_SWITCHER: function handleShowActionSheetQuickSwitcher(a0) {
let r32;
const r4 = {
key,
...a0
};
const { content, key: key2, impressionName: impressionName2, impressionProperties: impressionProperties2, backdropKind: backdropKind2, stackingBehavior = "replaceTopSheet", appEntryKey: appEntryKey2 = "main" } = r4;
L13: {
const r21 = {
content,
key: key2,
impressionName: impressionName2,
impressionProperties: impressionProperties2,
backdropKind: backdropKind2,
appEntryKey: appEntryKey2,
zIndex
};
const r2 = c2205_0.length < 3;
if (stackingBehavior === "replaceAll") {
r32 = [r21];
} else {
if (stackingBehavior === "stack" && r2) {
r32 = [...c2205_0, r21];
break L13;
}
r32 = c2205_0.slice(0, -1).concat(r21);
}
}
c2205_0 = r32;
},
HIDE_ACTION_SHEET: function handleHideActionSheet({ key: key2 }) {
let env13713;
const r7 = env13713 = {};
env13713[0] = key2;
if (key2 == null) {
c2205_0 = c2205_0.slice(0, -1);
}
c2205_0 = c2205_0.filter($mk73177(r7));
},
HIDE_ALL_ACTION_SHEETS: function handleHideAllActionSheets() {
c2205_0 = [];
},
HIDE_ACTION_SHEET_QUICK_SWITCHER: function handleHideActionSheetQuickSwitcher() {
let env13714;
const r3 = env13714 = {};
env13714[0] = key;
if (key == null) {
c2205_0 = c2205_0.slice(0, -1);
}
c2205_0 = c2205_0.filter($mk73177(r3));
},
SET_ACTION_SHEET_Z_INDEX: function handleSetActionSheetZIndex(a0) {
zIndex = a0.zIndex;
},
RESET_ACTION_SHEETS_FOR_APP_ENTRY_KEY: function handleResetActionSheetsForAppEntryKey({ appEntryKey }) {
const r8 = c2205_0.filter((item) => item.appEntryKey !== appEntryKey);
if (r8.length === c2205_0.length) {
return false;
}
c2205_0 = r8;
}
});
export default actionSheetStore;