129 lines
7.0 KiB
TypeScript
129 lines
7.0 KiB
TypeScript
/* Metro module 9575; source: stores/GuildAffinitiesStore.tsx; dependencies: [6, 7, 15, 17, 18, 1867, 9576, 566, 694, 2] */
|
|
import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import GuildStore from './GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
|
|
function _fun74915(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9761:6, offset: 0x01d9dbf2, size: 342 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let env0_8 = {};
|
|
(function() {
|
|
env0_8 = {guildAffinitiesByGuildId: {}, guildAffinities: [], lastFetched: 0};
|
|
})();
|
|
const PersistedStore = (Flux).PersistedStore;
|
|
let value = _fun74920(PersistedStore);
|
|
value.displayName = 'GuildAffinitiesStore';
|
|
value.persistKey = 'GuildAffinitiesStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{CONNECTION_OPEN: CONNECTION_OPEN_74927, LOAD_GUILD_AFFINITIES_SUCCESS: LOAD_GUILD_AFFINITIES_SUCCESS,
|
|
LOGOUT: function() {
|
|
setDefaultState();
|
|
}});
|
|
(FileImportTrackerModule).fileFinishedImporting('stores/GuildAffinitiesStore.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_74916() { // fn#74916, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9761:158, offset: 0x01d9dd48, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_74916_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun74920(a0) { // fn#74920, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9761:471, offset: 0x01d9ddce, size: 174 bytes, params: 2, frame: 16
|
|
const GuildAffinitiesStore2 = GuildAffinitiesStore;
|
|
Inherits(GuildAffinitiesStore2, a0);
|
|
return CreateClass(GuildAffinitiesStore2, [{key: 'initialize', value: value_74922}, {key: 'getState',
|
|
value: value_74923}, {key: 'getGuildAffinity', value: value_74924}, {key: 'affinities', get: get_74925},
|
|
{key: 'hasRequestResolved', get: get_74926}]);
|
|
function GuildAffinitiesStore() { // fn#74921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9761:483, offset: 0x00ec62ac, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_2(this, GuildAffinitiesStore);
|
|
const value3 = env1_5(GuildAffinitiesStore);
|
|
return env1_4(this, _isNativeReflectConstruct_74916() ? global.Reflect.construct(value3, arguments,
|
|
env1_5(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_74922(a0) { // fn#74922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9761:801, offset: 0x01d9de7c, size: 41 bytes, params: 2, frame: 11
|
|
var value;
|
|
if (a0 != null) {
|
|
value = environment.__proto__;
|
|
env1_8 = a0;
|
|
}
|
|
this.waitFor(GuildStore);
|
|
}
|
|
|
|
function value_74923() { // fn#74923, offset: 0x00fbd9d4, size: 9 bytes, params: 1, frame: 1
|
|
return env1_8;
|
|
}
|
|
|
|
function value_74924(a0) { // fn#74924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9761:920, offset: 0x01d9dea5, size: 22 bytes, params: 2, frame: 2
|
|
return env1_8.guildAffinitiesByGuildId[a0];
|
|
}
|
|
|
|
function get_74925() { // fn#74925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9761:993, offset: 0x01d9debb, size: 15 bytes, params: 1, frame: 1
|
|
return env1_8.guildAffinities;
|
|
}
|
|
|
|
function get_74926() { // fn#74926, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9761:1061, offset: 0x01d9deca, size: 21 bytes, params: 1, frame: 2
|
|
return env1_8.lastFetched !== 0;
|
|
}
|
|
|
|
}
|
|
|
|
function CONNECTION_OPEN_74927() { // fn#74927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9761:1236, offset: 0x01d9dedf, size: 80 bytes, params: 1, frame: 11
|
|
const Date = global.Date;
|
|
if (Date.now() - env0_8.lastFetched > 86400000) {
|
|
(require(9576) /* metro dependency 9576: GuildAffinitiesActionCreators */).fetchGuildAffinities();
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function LOAD_GUILD_AFFINITIES_SUCCESS({guildAffinities}) { // fn#74928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9761:1372, offset: 0x01d9df2f, size: 88 bytes, params: 2, frame: 12
|
|
let binding = env0_8;
|
|
binding.guildAffinities = [];
|
|
env0_8.guildAffinitiesByGuildId = {};
|
|
binding = env0_8;
|
|
const Date = global.Date;
|
|
binding.lastFetched = Date.now();
|
|
guildAffinities.forEach(_fun74929);
|
|
function _fun74929({affinity, guild_id}, a1) { // fn#74929, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9761:1522, offset: 0x01d9df87, size: 73 bytes, params: 3, frame: 12
|
|
const object = {score: affinity, guildId: guild_id, index: a1};
|
|
env1_8.guildAffinitiesByGuildId[guild_id] = object;
|
|
env1_8.guildAffinities.push(object);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun74915, 9575, [6, 7, 15, 17, 18, 1867, 9576, 566, 694,
|
|
2]) /* metro module 9575, dependencies: [6, 7, 15, 17, 18, 1867, 9576, 566, 694, 2] */;
|