decord/source/modules/app_launcher/utils/useLaunchingActivityButtonState.tsx

74 lines
2.6 KiB
TypeScript
Raw Normal View History

// Module ID: 12171
// Function ID: 12172
2026-07-20 16:05:17 +00:00
// Name: useLaunchingActivityButtonState
// Dependencies: [19, 1956, 9542, 7182, 504, 9538, 8300, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 12171 (useLaunchingActivityButtonState)
import noop from "module_19" /* 19 */;
import EmbeddedActivitiesStore from "EmbeddedActivitiesStore" /* 1956 */;
import FramesStore from "FramesStore" /* 9542 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/app_launcher/utils/useLaunchingActivityButtonState.tsx");
2026-07-20 16:05:17 +00:00
export default function useLaunchingActivityButtonState(applicationId) {
applicationId = applicationId.applicationId;
2026-07-23 10:11:24 +00:00
({ context: importDefault, onSubmissionComplete } = applicationId);
2026-08-24 06:08:38 +00:00
closure_4 = undefined;
const getOrFetchApplication = applicationId(onSubmissionComplete[3]).useGetOrFetchApplication(applicationId);
const obj = applicationId(onSubmissionComplete[3]);
let tmp = applicationId;
2026-08-24 06:08:38 +00:00
const items = [closure_4];
2026-07-23 10:11:24 +00:00
const stateFromStores = applicationId(onSubmissionComplete[4]).useStateFromStores(items, () => {
2026-07-20 16:05:17 +00:00
let id;
if ("channel" === importDefault.type) {
id = importDefault.channel.id;
2026-07-20 16:05:17 +00:00
}
return EmbeddedActivitiesStore.getLaunchState(applicationId, id);
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
const obj2 = applicationId(onSubmissionComplete[4]);
const items1 = [FramesStore];
let stateFromStores1 = applicationId(onSubmissionComplete[4]).useStateFromStores(items1, () => {
const mainFrame = FramesStore.getMainFrame();
2026-08-06 08:05:19 +00:00
let state;
if (mainFrame != null) {
state = mainFrame.state;
}
let tmp3 = "loading" === state;
if (tmp3) {
tmp3 = mainFrame.applicationId === applicationId;
}
return tmp3;
});
2026-07-20 16:05:17 +00:00
if (null == getOrFetchApplication) {
stateFromStores1 = null != stateFromStores && stateFromStores.isLaunching && stateFromStores.componentId === applicationId.launchingComponentId;
const tmp6 = null != stateFromStores && stateFromStores.isLaunching && stateFromStores.componentId === applicationId.launchingComponentId;
} else {
2026-07-29 08:29:29 +00:00
const tmpResult = tmp(tmp2[5]);
2026-07-20 16:05:17 +00:00
}
let tmp7 = require("usePrevious")(stateFromStores1);
2026-08-24 06:08:38 +00:00
closure_4 = tmp7;
2026-07-20 16:05:17 +00:00
const items2 = [stateFromStores1, tmp7, onSubmissionComplete];
2026-07-23 10:11:24 +00:00
const effect = stateFromStores1.useEffect(() => {
2026-07-29 08:29:29 +00:00
let tmp = !stateFromStores1;
if (!stateFromStores1) {
2026-08-24 06:08:38 +00:00
tmp = closure_4;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-29 08:29:29 +00:00
if (onSubmissionComplete != null) {
tmp2();
2026-07-20 16:05:17 +00:00
}
}
}, items2);
const obj4 = { submitting: stateFromStores1, wasSubmitting: null };
2026-07-29 08:29:29 +00:00
if (tmp7 == null) {
tmp7 = null;
2026-07-20 16:05:17 +00:00
}
obj4.wasSubmitting = tmp7;
return obj4;
2026-07-20 16:05:17 +00:00
};