decord/source/actions/ModalActionCreators.tsx

93 lines
3.4 KiB
TypeScript
Raw Normal View History

// Module ID: 4839
// Function ID: 4840
// Name: ModalActionCreators
// Dependencies: [1074, 4840, 4494, 4841, 573, 4495, 4842, 2]
2026-07-20 16:05:17 +00:00
// Module 4839 (ModalActionCreators)
import DispatcherDefault from "Dispatcher" /* 573 */;
import Constants from "Constants" /* 1074 */;
import NavigationRouteUtils from "NavigationRouteUtils" /* 4494 */;
import uniqueIdDefault from "uniqueId" /* 4840 */;
import getDeprecatedModalDataDefault from "getDeprecatedModalData" /* 4841 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const AppContext = Constants.AppContext;
const result = size.fileFinishedImporting("actions/ModalActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export default {
push(modal, props) {
let tmp = arg2;
if (arg2 === undefined) {
2026-08-24 06:08:38 +00:00
tmp = uniqueIdDefault("modal");
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let APP = arg4;
if (arg4 === undefined) {
2026-07-20 16:05:17 +00:00
APP = AppContext.APP;
}
const obj = NavigationRouteUtils;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg3);
obj.pushModal({ modal: getDeprecatedModalDataDefault(modal, {}, props, tmp) });
const obj2 = { modal: getDeprecatedModalDataDefault(modal, {}, props, tmp) };
const element = { type: "MODAL_PUSH", modal, props, key: tmp, appContext: APP };
DispatcherDefault.dispatch(element);
2026-07-20 16:05:17 +00:00
return tmp;
},
pushLazy(promise, merged, c3, navigationParams) {
2026-07-23 10:11:24 +00:00
const self = this;
importDefault = promise;
dependencyMap = merged;
2026-08-27 16:17:25 +00:00
let tmp = c3;
if (c3 === undefined) {
2026-08-24 06:08:38 +00:00
tmp = uniqueIdDefault("modal");
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_3 = tmp;
_require = navigationParams;
const rootNavigationRef = require("RootNavigationRef").getRootNavigationRef();
2026-07-20 16:05:17 +00:00
if (null != rootNavigationRef) {
if (rootNavigationRef.isReady()) {
if (promise instanceof Promise) {
let nextPromise = promise.then((result) => result.default);
2026-07-20 16:05:17 +00:00
} else {
nextPromise = promise();
2026-07-20 16:05:17 +00:00
}
nextPromise.then((result) => self.push(result, closure_2, closure_3, closure_0));
2026-07-20 16:05:17 +00:00
}
}
const obj = require("RootNavigationRef");
2026-07-20 16:05:17 +00:00
return new Promise((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
return promise(merged[6]).enqueue(() => closure_0(self.pushLazy(closure_1, closure_2, closure_3, closure_0)));
2026-07-20 16:05:17 +00:00
});
},
updateAnimation(key, SLIDE_IN_OUT) {
const element = { type: "MODAL_UPDATE", key, props: {}, partial: true, animation: SLIDE_IN_OUT };
DispatcherDefault.dispatch(element);
2026-07-20 16:05:17 +00:00
},
pop() {
NavigationRouteUtils.popModal();
DispatcherDefault.dispatch({ type: "MODAL_POP" });
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
popWithKey(c3, onExited) {
NavigationRouteUtils.popModal(c3, onExited);
DispatcherDefault.dispatch({ type: "MODAL_POP", key: c3, onExited });
2026-07-20 16:05:17 +00:00
},
popAboveKey(voiceChannelKey) {
return NavigationRouteUtils.popModalsAboveKey(voiceChannelKey);
2026-07-20 16:05:17 +00:00
},
popAll() {
NavigationRouteUtils.popAllModals();
DispatcherDefault.dispatch({ type: "MODAL_POP_ALL" });
DispatcherDefault.dispatch({ type: "EMAIL_VERIFICATION_MODAL_CLOSE" });
DispatcherDefault.dispatch({ type: "GUILD_SETTINGS_CLOSE" });
DispatcherDefault.dispatch({ type: "HIDE_ACTION_SHEET" });
DispatcherDefault.dispatch({ type: "DISPLAYED_INVITE_CLEAR" });
DispatcherDefault.dispatch({ type: "NOTIFICATION_SETTINGS_MODAL_CLOSE" });
DispatcherDefault.dispatch({ type: "QUICKSWITCHER_HIDE" });
DispatcherDefault.dispatch({ type: "USER_SETTINGS_MODAL_CLOSE" });
DispatcherDefault.dispatch({ type: "CONNECTIONS_GRID_MODAL_HIDE" });
DispatcherDefault.dispatch({ type: "USER_PROFILE_MODAL_CLOSE" });
2026-07-20 16:05:17 +00:00
}
};