decord/stable/source/modules/vibegrations/lib/useIsOwnedVibegrationsApplication.tsx
github-actions 57c2214117 chore: update source for stable 347.12
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
2026-09-29 21:26:22 +00:00

96 lines
3.1 KiB
TypeScript

// Module ID: 9340
// Function ID: 9341
// Name: useIsOwnedVibegrationsApplication
// Dependencies: [19, 2063, 9341, 559, 504, 5306, 9342, 2]
// Exports: default
// Module 9340 (useIsOwnedVibegrationsApplication)
import BackoffDefault from "Backoff" /* 559 */;
import VibegrationsUtils from "VibegrationsUtils" /* 5306 */;
import VibegrationsActionCreators from "VibegrationsActionCreators" /* 9342 */;
import noop from "module_19" /* 19 */;
import GuildStore from "GuildStore" /* 2063 */;
import VibegrationsProjectStore from "VibegrationsProjectStore" /* 9341 */;
const require = globalThis.__r;
require = fn;
const isProjectOwner = fn(9341).isProjectOwner;
let closure_6 = new BackoffDefault(30000, 300000);
const size = fn(2);
let result = size.fileFinishedImporting("modules/vibegrations/lib/useIsOwnedVibegrationsApplication.tsx");
export default function useIsOwnedVibegrationsApplication(arg0, arg1) {
_require = arg0;
dependencyMap = arg1;
const items = [stateFromStores1];
const items1 = [arg1, arg0];
const stateFromStores = require("initialize").useStateFromStores(items, () => {
let tmp = closure_1;
if (closure_1) {
tmp = null != closure_0;
}
if (tmp) {
tmp = VibegrationsUtils.eligibleVibegrationsGuilds(GuildStore.getGuildsArray(), "useIsOwnedVibegrationsApplication").length > 0;
}
return tmp;
}, items1);
let obj = require("initialize");
const items2 = [VibegrationsProjectStore];
stateFromStores1 = require("initialize").useStateFromStores(items2, () => {
projectsFetchState = projectsFetchState.getProjectsFetchState();
let type;
if (projectsFetchState != null) {
type = projectsFetchState.type;
}
if (type == null) {
type = null;
}
return type;
});
const items3 = [stateFromStores, stateFromStores1];
const effect = stateFromStores.useEffect(() => {
if ("success" === stateFromStores1) {
closure_6.succeed();
}
if (stateFromStores) {
if (null != tmp) {
let pending = "error" !== tmp;
if (!pending) {
pending = closure_6.pending;
}
if (!pending) {
closure_6.fail(() => closure_1_0(closure_1_1[6]).listProjects());
}
} else {
VibegrationsActionCreators.listProjects();
}
}
}, items3);
const obj2 = require("initialize");
const items4 = [VibegrationsProjectStore];
const items5 = [stateFromStores, arg0];
return require("initialize").useStateFromStores(items4, () => {
if (stateFromStores) {
if (null != closure_0) {
const result = VibegrationsProjectStore.findProjectByApplicationId(tmp);
let tmp4 = null == result;
if (!tmp4) {
tmp4 = !isProjectOwner(result);
}
let tmp6 = !tmp4;
if (tmp4) {
projectsFetchState = VibegrationsProjectStore.getProjectsFetchState();
let type;
if (projectsFetchState != null) {
type = projectsFetchState.type;
}
tmp6 = "success" !== type && null;
const tmp9 = "success" !== type && null;
}
return tmp6;
}
}
return false;
}, items5);
};