decord/source/modules/channel/hooks/useRequiredLinkedLobbyApplicationAuthorization.tsx

126 lines
5 KiB
TypeScript
Raw Normal View History

// Module ID: 12466
// Function ID: 12467
2026-07-20 16:05:17 +00:00
// Name: useRequiredLinkedLobbyApplicationAuthorization
// Dependencies: [19, 4802, 7121, 504, 7184, 7177, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 12466 (useRequiredLinkedLobbyApplicationAuthorization)
import _mod19 from "module_19" /* 19 */;
import AuthorizedAppsStore2 from "AuthorizedAppsStore" /* 7121 */;
import ApplicationActionCreatorsDefault from "ApplicationActionCreators" /* 7177 */;
import AuthorizedAppsActionCreatorsDefault from "AuthorizedAppsActionCreators" /* 7184 */;
import ApplicationStore from "ApplicationStore" /* 4802 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const AuthorizedAppsStore = AuthorizedAppsStore2;
const useEffect = _mod19.useEffect;
const FetchState = AuthorizedAppsStore2.FetchState;
const result = size.fileFinishedImporting("modules/channel/hooks/useRequiredLinkedLobbyApplicationAuthorization.tsx");
2026-07-20 16:05:17 +00:00
export default function useRequiredLinkedLobbyApplicationAuthorization(require_application_authorization) {
2026-07-29 08:29:29 +00:00
let prop;
if (require_application_authorization != null) {
prop = require_application_authorization.require_application_authorization;
}
2026-07-20 16:05:17 +00:00
let application_id = null;
2026-07-29 08:29:29 +00:00
if (prop) {
application_id = require_application_authorization.application_id;
2026-07-20 16:05:17 +00:00
}
let items = [AuthorizedAppsStore];
const stateFromStoresObject = application_id(stateFromStores[3]).useStateFromStoresObject(items, () => ({ authorizationsFetchState: AuthorizedAppsStore.getFetchState(), applicationOAuth2Token: AuthorizedAppsStore.getNewestTokenForApplication(application_id) }));
2026-07-20 16:05:17 +00:00
const authorizationsFetchState = stateFromStoresObject.authorizationsFetchState;
const applicationOAuth2Token = stateFromStoresObject.applicationOAuth2Token;
let obj = application_id(stateFromStores[3]);
const items1 = [ApplicationStore];
stateFromStores = application_id(stateFromStores[3]).useStateFromStores(items1, () => ApplicationStore.getApplication(application_id));
2026-07-23 10:11:24 +00:00
const obj2 = application_id(stateFromStores[3]);
const items2 = [ApplicationStore];
2026-07-29 08:29:29 +00:00
let stateFromStores1 = application_id(stateFromStores[3]).useStateFromStores(items2, () => {
2026-07-20 16:05:17 +00:00
let parentId;
2026-07-29 08:29:29 +00:00
if (stateFromStores != null) {
2026-07-20 16:05:17 +00:00
parentId = stateFromStores.parentId;
}
return ApplicationStore.getApplication(parentId);
2026-07-20 16:05:17 +00:00
});
2026-08-14 17:33:39 +00:00
const obj3 = application_id(stateFromStores[3]);
const items3 = [AuthorizedAppsStore];
2026-08-14 17:33:39 +00:00
const items4 = [authorizationsFetchState, application_id];
const stateFromStores2 = application_id(stateFromStores[3]).useStateFromStores(items3, () => {
let parentId;
if (stateFromStores != null) {
parentId = stateFromStores.parentId;
}
return AuthorizedAppsStore.getNewestTokenForApplication(parentId);
2026-08-14 17:33:39 +00:00
});
2026-07-23 10:11:24 +00:00
stateFromStores1(() => {
2026-07-20 16:05:17 +00:00
let tmp = null != application_id;
if (tmp) {
tmp = authorizationsFetchState === FetchState.NOT_FETCHED;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
const response = AuthorizedAppsActionCreatorsDefault.fetch();
2026-07-20 16:05:17 +00:00
}
2026-08-14 17:33:39 +00:00
}, items4);
const items5 = [application_id, applicationOAuth2Token, authorizationsFetchState, stateFromStores];
2026-07-23 10:11:24 +00:00
stateFromStores1(() => {
2026-07-29 08:29:29 +00:00
let tmp2 = null != application_id;
if (tmp2) {
tmp2 = null == stateFromStores;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp2) {
tmp2 = authorizationsFetchState === FetchState.FETCHED;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp2) {
2026-07-20 16:05:17 +00:00
const items = [application_id];
const applications = ApplicationActionCreatorsDefault.fetchApplications(items, false);
2026-07-20 16:05:17 +00:00
}
2026-08-14 17:33:39 +00:00
}, items5);
const items6 = [stateFromStores, authorizationsFetchState, stateFromStores1];
2026-07-23 10:11:24 +00:00
stateFromStores1(() => {
2026-07-29 08:29:29 +00:00
let tmp2 = null != stateFromStores && null != tmp.parentId;
if (tmp2) {
tmp2 = null == stateFromStores1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp2) {
tmp2 = authorizationsFetchState === FetchState.FETCHED;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp2) {
const items = [tmp.parentId];
const applications = ApplicationActionCreatorsDefault.fetchApplications(items, false);
2026-07-20 16:05:17 +00:00
}
2026-08-14 17:33:39 +00:00
}, items6);
let tmp10 = null != stateFromStores;
if (tmp10) {
tmp10 = null == stateFromStores.parentId || null != stateFromStores1;
const tmp11 = null == stateFromStores.parentId || null != stateFromStores1;
}
let tmp13 = tmp12;
if (null == applicationOAuth2Token && null != stateFromStores && tmp10) {
tmp13 = null != stateFromStores1;
}
if (tmp13) {
tmp13 = null != stateFromStores2;
2026-07-20 16:05:17 +00:00
}
2026-08-14 17:33:39 +00:00
let tmp14 = null != application_id;
if (tmp14) {
tmp14 = authorizationsFetchState !== FetchState.FETCHED || null == stateFromStores || !tmp10;
const tmp16 = authorizationsFetchState !== FetchState.FETCHED || null == stateFromStores || !tmp10;
2026-07-20 16:05:17 +00:00
}
const obj5 = { showLinkedLobbyApplicationLoadingIndicator: tmp14, requiredLinkedLobbyApplication: null, shouldRelaunchLinkedLobbyApplication: null };
2026-08-14 17:33:39 +00:00
let tmp17 = null;
if (null == applicationOAuth2Token && null != stateFromStores && tmp10) {
let tmp18 = stateFromStores;
if (!tmp13) {
if (stateFromStores1 == null) {
stateFromStores1 = stateFromStores;
2026-07-20 16:05:17 +00:00
}
2026-08-14 17:33:39 +00:00
tmp18 = stateFromStores1;
2026-07-20 16:05:17 +00:00
}
2026-08-14 17:33:39 +00:00
tmp17 = tmp18;
2026-07-20 16:05:17 +00:00
}
obj5.requiredLinkedLobbyApplication = tmp17;
obj5.shouldRelaunchLinkedLobbyApplication = tmp13;
return obj5;
2026-07-20 16:05:17 +00:00
};