decord/source/stores/GuildAffinitiesStore.tsx

120 lines
3.5 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 8360
// Function ID: 66042
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-24 07:16:23 +00:00
// Dependencies: [6, 7, 15, 17, 18, 1838, 8361, 566, 686, 2]
2026-07-20 16:05:17 +00:00
2026-07-24 07:16:23 +00:00
// Module 8360 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import fetchGuildAffinities from "fetchGuildAffinities";
import initialize from "initialize";
import _possibleConstructorReturn from "_possibleConstructorReturn";
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
const require = arg1;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
function setDefaultState() {
let closure_8 = { guildAffinitiesByGuildId: {}, guildAffinities: [], lastFetched: 0 };
}
let closure_8 = {};
setDefaultState();
2026-07-23 10:11:24 +00:00
let tmp3 = ((PersistedStore) => {
2026-07-20 16:05:17 +00:00
class GuildAffinitiesStore {
constructor() {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_2(this, GuildAffinitiesStore);
obj = outer1_5(GuildAffinitiesStore);
tmp2 = outer1_4;
if (outer1_9()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_5;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_5(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
return tmp2(self, constructResult);
}
}
callback2(GuildAffinitiesStore, PersistedStore);
let obj = {
key: "initialize",
value(arg0) {
const self = this;
2026-07-23 10:11:24 +00:00
if (null != arg0) {
const outer1_8 = arg0;
}
self.waitFor(outer1_7);
2026-07-20 16:05:17 +00:00
}
};
const items = [obj, , , , ];
obj = {
key: "getState",
value() {
2026-07-23 10:11:24 +00:00
return outer1_8;
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
obj = {
key: "getGuildAffinity",
value(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_8.guildAffinitiesByGuildId[arg0];
2026-07-20 16:05:17 +00:00
}
};
items[2] = obj;
items[3] = {
key: "affinities",
get() {
2026-07-23 10:11:24 +00:00
return outer1_8.guildAffinities;
2026-07-20 16:05:17 +00:00
}
};
items[4] = {
key: "hasRequestResolved",
get() {
2026-07-23 10:11:24 +00:00
return 0 !== outer1_8.lastFetched;
2026-07-20 16:05:17 +00:00
}
};
return callback(GuildAffinitiesStore, items);
2026-07-23 10:11:24 +00:00
})(require("initialize").PersistedStore);
2026-07-20 16:05:17 +00:00
tmp3.displayName = "GuildAffinitiesStore";
tmp3.persistKey = "GuildAffinitiesStore";
2026-07-23 10:11:24 +00:00
tmp3 = new tmp3(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: function handleConnectionOpen() {
if (Date.now() - lastFetched.lastFetched > 86400000) {
2026-07-24 07:16:23 +00:00
const guildAffinities = require(8361) /* fetchGuildAffinities */.fetchGuildAffinities();
const obj = require(8361) /* fetchGuildAffinities */;
2026-07-20 16:05:17 +00:00
}
return false;
},
LOAD_GUILD_AFFINITIES_SUCCESS: function handleLoadGuildAffinitiesSuccess(guildAffinities) {
guildAffinities = guildAffinities.guildAffinities;
closure_8.guildAffinities = [];
closure_8.guildAffinitiesByGuildId = {};
closure_8.lastFetched = Date.now();
const item = guildAffinities.forEach((guild_id, index) => {
guild_id = guild_id.guild_id;
const obj = { score: guild_id.affinity, guildId: guild_id, index };
2026-07-23 10:11:24 +00:00
outer1_8.guildAffinitiesByGuildId[guild_id] = obj;
const guildAffinities = outer1_8.guildAffinities;
2026-07-20 16:05:17 +00:00
guildAffinities.push(obj);
});
},
LOGOUT: function handleLogout() {
setDefaultState();
}
});
2026-07-23 10:11:24 +00:00
let result = require("_possibleConstructorReturn").fileFinishedImporting("stores/GuildAffinitiesStore.tsx");
2026-07-20 16:05:17 +00:00
export default tmp3;