70 lines
4.4 KiB
TypeScript
70 lines
4.4 KiB
TypeScript
/* Metro module 7693; source: modules/user_affinities/UserAffinitiesActionCreators.tsx; dependencies: [5078, 5221, 661, 694, 507, 2] */
|
|
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import ConsentStore from '../../stores/ConsentStore.tsx'; /* Metro dependency 5078 */
|
|
import UserAffinitiesV2Store from './UserAffinitiesV2Store.tsx'; /* Metro dependency 5221 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
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});
|
|
(FileImportTrackerModule).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 consentStoreBinding;
|
|
var value2;
|
|
var HTTP;
|
|
let value = a0;
|
|
const r7 = !(value !== undefined) || value;
|
|
const userAffinitiesV2StoreBinding = UserAffinitiesV2Store;
|
|
if (userAffinitiesV2StoreBinding.shouldFetch()) {
|
|
consentStoreBinding = ConsentStore;
|
|
if (consentStoreBinding.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: r7 ? 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 object = {type: 'LOAD_USER_AFFINITIES_V2_SUCCESS'};
|
|
const user_affinities = body.user_affinities;
|
|
object.affineUsers = user_affinities.map(_fun61453);
|
|
Reflect.apply(dispatch, value, [object]);
|
|
}
|
|
|
|
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__;
|
|
(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};
|
|
}
|
|
|
|
global.__d(_fun61450, 7693, [5078, 5221, 661, 694, 507,
|
|
2]) /* metro module 7693, dependencies: [5078, 5221, 661, 694, 507, 2] */;
|