64 lines
3.9 KiB
TypeScript
64 lines
3.9 KiB
TypeScript
/* Metro module 7693; source: modules/user_affinities/UserAffinitiesActionCreators.tsx; dependencies: [5078, 5221, 661, 694, 507, 2] */
|
|
function _fun61450(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61450, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7871:6, offset: 0x01b40263, size: 164 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const consentStore = importDefault(5078) /* metro dependency 5078: ConsentStore */;
|
|
const userAffinitiesV2Store = importDefault(5221) /* metro dependency 5221: UserAffinitiesV2Store */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_5 = constantsModule.Endpoints;
|
|
const env0_6 = constantsModule.Consents;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_affinities/UserAffinitiesActionCreators.tsx');
|
|
exports.fetchUserAffinitiesV2 = fetchUserAffinitiesV2;
|
|
}
|
|
|
|
function fetchUserAffinitiesV2() { // fn#61451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7871:267, offset: 0x01b40307, size: 221 bytes, params: 1, frame: 20
|
|
var r0;
|
|
var value2;
|
|
var HTTP;
|
|
let value = a0;
|
|
if (UserAffinitiesV2Store.shouldFetch()) {
|
|
if (ConsentStore.hasConsented(Consents.PERSONALIZATION)) {
|
|
value2 = 3;
|
|
importDefault(dependencyMap[value2]).dispatch({type: 'LOAD_USER_AFFINITIES_V2'});
|
|
HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
value = 0;
|
|
value = HTTP.get({url: Endpoints.USER_AFFINITIES_V2,
|
|
retries: !(value !== undefined) || value ? value2 : value,
|
|
oldFormErrors: true, rejectWithError: false});
|
|
value = value.then(_fun61452, _fun61454);
|
|
r0 = value;
|
|
} else {
|
|
r0 = global.Promise.resolve();
|
|
}
|
|
} else {
|
|
r0 = global.Promise.resolve();
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun61452({body}) { // fn#61452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7871:515, offset: 0x01b403e4, size: 87 bytes, params: 2, frame: 15
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
const dispatch = value.dispatch;
|
|
const object2 = {type: 'LOAD_USER_AFFINITIES_V2_SUCCESS'};
|
|
const user_affinities = body.user_affinities;
|
|
object2.affineUsers = user_affinities.map(_fun61453);
|
|
Reflect.apply(dispatch, value, [object2]);
|
|
}
|
|
|
|
function _fun61454() { // fn#61454, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7871:1168, offset: 0x01b40544, size: 49 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'LOAD_USER_AFFINITIES_V2_FAILURE'});
|
|
}
|
|
|
|
function _fun61453({other_user_id, user_segment, other_user_segment, is_friend, dm_probability, dm_rank, vc_probability, vc_rank, server_message_probability, server_message_rank, communication_probability, communication_rank}) { // fn#61453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7871:620, offset: 0x01b4043b, size: 265 bytes, params: 2, frame: 7
|
|
return {otherUserId: other_user_id, userSegment: user_segment, otherUserSegment: other_user_segment,
|
|
isFriend: is_friend, dmProbability: dm_probability ?? 0, dmRank: dm_rank ?? 0,
|
|
vcProbability: vc_probability ?? 0, vcRank: vc_rank ?? 0,
|
|
serverMessageProbability: server_message_probability ?? 0, serverMessageRank: server_message_rank ?? 0,
|
|
communicationProbability: communication_probability ?? 0, communicationRank: communication_rank ?? 0};
|
|
}
|
|
|