2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 6589
|
|
|
|
|
// Function ID: 6590
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: useGetOrFetchApplications
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [19, 5063, 558, 6584, 12, 1370, 504, 2]
|
2026-09-26 17:57:22 +00:00
|
|
|
// Exports: default, useGetOrFetchApplication
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// Module 6589 (useGetOrFetchApplications)
|
2026-09-18 19:45:33 +00:00
|
|
|
import _modDef12 from "module_12" /* 12 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import shallowEqual from "shallowEqual" /* 558 */;
|
2026-09-26 17:57:22 +00:00
|
|
|
import GlobalUtils from "GlobalUtils" /* 1370 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import ApplicationActionCreatorsDefault from "ApplicationActionCreators" /* 6584 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import react from "react" /* 19 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import ApplicationStore from "ApplicationStore" /* 5063 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-26 17:57:22 +00:00
|
|
|
|
|
|
|
|
const require = globalThis.__r;
|
2026-10-01 14:13:23 +00:00
|
|
|
let _require, application, dependencyMap;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-26 17:57:22 +00:00
|
|
|
const result = size.fileFinishedImporting("modules/applications/useGetOrFetchApplications.tsx");
|
|
|
|
|
|
|
|
|
|
export default function useGetOrFetchApplications(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_0;
|
|
|
|
|
let closure_2;
|
2026-09-26 17:57:22 +00:00
|
|
|
_require = arg0;
|
2026-09-18 19:45:33 +00:00
|
|
|
let flag = arg1;
|
|
|
|
|
if (arg1 === undefined) {
|
|
|
|
|
flag = true;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
dependencyMap = react.useRef([]);
|
2026-09-26 17:57:22 +00:00
|
|
|
const items = [arg0, flag];
|
2026-10-01 14:13:23 +00:00
|
|
|
const effect = react.useEffect(() => {
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp = flag;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp) {
|
|
|
|
|
const obj = shallowEqual;
|
|
|
|
|
tmp = !obj.areArraysShallowEqual(items1, ref.current);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (tmp) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const fetchApplications = ApplicationActionCreatorsDefault.fetchApplications;
|
|
|
|
|
ApplicationActionCreatorsDefault;
|
2026-09-26 17:57:22 +00:00
|
|
|
const arr = _modDef12(items1);
|
2026-10-01 14:13:23 +00:00
|
|
|
const found = arr.filter(GlobalUtils.isNotNullish);
|
2026-09-18 19:45:33 +00:00
|
|
|
const iter = found.uniq();
|
2026-10-01 14:13:23 +00:00
|
|
|
const applications = fetchApplications(iter.value(), false);
|
|
|
|
|
ref.current = items1;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}, items);
|
|
|
|
|
const items1 = [ApplicationStore];
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = require("get initialized");
|
|
|
|
|
return obj.useStateFromStoresArray(items1, () => items1.map((item) => {
|
2026-09-18 19:45:33 +00:00
|
|
|
application = undefined;
|
|
|
|
|
if (null != item) {
|
|
|
|
|
application = application.getApplication(item);
|
|
|
|
|
}
|
|
|
|
|
return application;
|
|
|
|
|
}));
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|
|
|
|
|
export const useGetOrFetchApplication = function useGetOrFetchApplication(applicationId, fetchesApplication) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let items1;
|
|
|
|
|
let ref;
|
2026-09-26 17:57:22 +00:00
|
|
|
let flag = fetchesApplication;
|
|
|
|
|
if (fetchesApplication === undefined) {
|
2026-09-18 19:45:33 +00:00
|
|
|
flag = true;
|
|
|
|
|
}
|
2026-09-26 17:57:22 +00:00
|
|
|
if (null != applicationId) {
|
|
|
|
|
const items = [applicationId];
|
2026-10-01 14:13:23 +00:00
|
|
|
items1 = items;
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
|
|
|
|
items1 = [];
|
|
|
|
|
}
|
2026-09-26 17:57:22 +00:00
|
|
|
if (flag === undefined) {
|
|
|
|
|
flag = true;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
dependencyMap = react.useRef([]);
|
2026-09-26 17:57:22 +00:00
|
|
|
const items2 = [items1, flag];
|
2026-10-01 14:13:23 +00:00
|
|
|
const effect = react.useEffect(() => {
|
2026-09-26 17:57:22 +00:00
|
|
|
let tmp = flag;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp) {
|
|
|
|
|
const obj = shallowEqual;
|
|
|
|
|
tmp = !obj.areArraysShallowEqual(items1, ref.current);
|
2026-09-26 17:57:22 +00:00
|
|
|
}
|
|
|
|
|
if (tmp) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const fetchApplications = ApplicationActionCreatorsDefault.fetchApplications;
|
|
|
|
|
ApplicationActionCreatorsDefault;
|
2026-09-26 17:57:22 +00:00
|
|
|
const arr = _modDef12(items1);
|
2026-10-01 14:13:23 +00:00
|
|
|
const found = arr.filter(GlobalUtils.isNotNullish);
|
2026-09-26 17:57:22 +00:00
|
|
|
const iter = found.uniq();
|
2026-10-01 14:13:23 +00:00
|
|
|
const applications = fetchApplications(iter.value(), false);
|
|
|
|
|
ref.current = items1;
|
2026-09-26 17:57:22 +00:00
|
|
|
}
|
|
|
|
|
}, items2);
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj = items1(504);
|
2026-09-26 17:57:22 +00:00
|
|
|
const items3 = [ApplicationStore];
|
2026-10-01 14:13:23 +00:00
|
|
|
return obj.useStateFromStoresArray(items3, () => items1.map((item) => {
|
2026-09-26 17:57:22 +00:00
|
|
|
application = undefined;
|
|
|
|
|
if (null != item) {
|
|
|
|
|
application = application.getApplication(item);
|
|
|
|
|
}
|
|
|
|
|
return application;
|
|
|
|
|
}))[0];
|
|
|
|
|
};
|