Files
discord-decomp/modules/app_launcher/AppLauncherStore.tsx
T
2026-11-01 12:12:55 +02:00

98 lines
3.2 KiB
TypeScript

// Metro module 8016 (f8017).
import { AppLauncherCloseReason, AppLauncherEntrypoint } from "./AppLauncherTypes";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c5075_2;
const handleDismissWithDismissed = function handleDismissWithDismissed() {
let DISMISSED = AppLauncherCloseReason.DISMISSED;
if (DISMISSED === void 0) {
DISMISSED = AppLauncherCloseReason.DISMISSED;
}
c5075_2.show = false;
c5075_2.entrypoint = AppLauncherEntrypoint.NONE;
c5075_2.closeReason = DISMISSED;
c5075_2.initialState = void 0;
c5075_2.activeChannelId = null;
};
const handleSetActiveCommand = function handleSetActiveCommand() {
let COMMAND = AppLauncherCloseReason.COMMAND;
if (COMMAND === void 0) {
COMMAND = AppLauncherCloseReason.DISMISSED;
}
c5075_2.show = false;
c5075_2.entrypoint = AppLauncherEntrypoint.NONE;
c5075_2.closeReason = COMMAND;
c5075_2.initialState = void 0;
c5075_2.activeChannelId = null;
};
c5075_2 = {
show: false,
entrypoint: AppLauncherEntrypoint.NONE,
lastShownEntrypoint: AppLauncherEntrypoint.NONE,
activeViewType: null,
activeChannelId: null,
closeReason: AppLauncherCloseReason.DISMISSED,
initialState: void 0
};
class AppLauncherStore extends Module589.Store {
static displayName = "AppLauncherStore";
initialize() {}
shouldShowPopup() {
return c5075_2.show && c5075_2.entrypoint === AppLauncherEntrypoint.TEXT;
}
shouldShowModal() {
return c5075_2.show && c5075_2.entrypoint === AppLauncherEntrypoint.VOICE;
}
entrypoint() {
return c5075_2.entrypoint;
}
lastShownEntrypoint() {
return c5075_2.lastShownEntrypoint;
}
activeViewType() {
return c5075_2.activeViewType;
}
activeChannelId() {
let activeChannelId2 = c5075_2.activeChannelId;
if (activeChannelId2 == null) {
activeChannelId2 = null;
}
return activeChannelId2;
}
closeReason() {
return c5075_2.closeReason;
}
initialState() {
return c5075_2.initialState;
}
}
const appLauncherStore = new AppLauncherStore(Dispatcher, {
APP_LAUNCHER_SHOW: function handleShow({ entrypoint: entrypoint2, activeViewType: activeViewType2, initialState: initialState2, activeChannelId: activeChannelId2 }) {
c5075_2.show = true;
c5075_2.entrypoint = entrypoint2;
c5075_2.lastShownEntrypoint = entrypoint2;
c5075_2.closeReason = AppLauncherCloseReason.DISMISSED;
c5075_2.activeViewType = activeViewType2;
c5075_2.activeChannelId = activeChannelId2;
c5075_2.initialState = initialState2;
return true;
},
APP_LAUNCHER_DISMISS: function handleDismiss({ closeReason: closeReason2 }) {
if (closeReason2 === void 0) {
closeReason2 = AppLauncherCloseReason.DISMISSED;
}
c5075_2.show = false;
c5075_2.entrypoint = AppLauncherEntrypoint.NONE;
c5075_2.closeReason = closeReason2;
c5075_2.initialState = void 0;
c5075_2.activeChannelId = null;
return true;
},
CONNECTION_OPEN: handleDismissWithDismissed,
LOGOUT: handleDismissWithDismissed,
CHANNEL_SELECT: handleDismissWithDismissed,
APPLICATION_COMMAND_SET_ACTIVE_COMMAND: handleSetActiveCommand,
APP_LAUNCHER_SET_ACTIVE_COMMAND: handleSetActiveCommand
});
export default appLauncherStore;