Files
discord-decomp/modules/application_account_linking/native/getShouldShowAppAuthPrompt.tsx
T
2026-11-01 12:12:55 +02:00

33 lines
1.1 KiB
TypeScript

// Metro module 10955 (f10956).
import AuthorizedAppsStore, { FetchState } from "../../oauth2/AuthorizedAppsStore";
import { getAuthorizationApp } from "../hooks/useAuthorizationApp";
import AuthorizedAppsActionCreators from "../../oauth2/AuthorizedAppsActionCreators";
export function getShouldShowAppAuthPrompt(a0) {
let r29;
if (a0 == null) {
return false;
}
const authorizationApp = getAuthorizationApp(a0);
if (authorizationApp == null) {
return false;
}
if (authorizationApp?.connectionEntrypointUrl != null) {
let r17 = authorizationApp?.parentId;
if (r17 == null) {
r17 = authorizationApp?.id;
}
let r20 = r17 != null;
if (r20) {
if (AuthorizedAppsStore.getFetchStateForApplication(r17) === FetchState.NOT_FETCHED) {
AuthorizedAppsActionCreators.fetch([r17]);
r29 = false;
} else {
r29 = !(AuthorizedAppsStore.getFetchStateForApplication(r17) === FetchState.FETCHED && AuthorizedAppsStore.getNewestTokenForApplication(r17) != null);
}
r20 = r29;
}
return r20;
}
return false;
}