113 lines
6.4 KiB
TypeScript
113 lines
6.4 KiB
TypeScript
/* Metro module 9537; source: actions/SurveyActionCreators.tsx; dependencies: [9536, 661, 694, 683, 5046, 480, 1392, 2] */
|
|
function _fun74410(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:6, offset: 0x01d8ce03, size: 218 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const surveyStore = importDefault(9536) /* metro dependency 9536: SurveyStore */;
|
|
const env0_4 = (require(9536) /* metro dependency 9536: SurveyStore */).SURVEY_REFETCH_INTERVAL;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_5 = constantsModule.AnalyticEvents;
|
|
const env0_6 = constantsModule.NoticeTypes;
|
|
const env0_7 = constantsModule.Endpoints;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('actions/SurveyActionCreators.tsx');
|
|
exports.overrideSurvey = overrideSurvey;
|
|
exports.surveyHide = surveyHide;
|
|
exports.surveyFetch = surveyFetch;
|
|
exports.surveySeen = surveySeen;
|
|
}
|
|
|
|
function overrideSurvey(a0) { // fn#74411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:282, offset: 0x01d8cedd, size: 54 bytes, params: 2, frame: 13
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SURVEY_OVERRIDE', id: a0});
|
|
}
|
|
|
|
function surveyHide(a0, a1) { // fn#74412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:371, offset: 0x01d8cf13, size: 163 bytes, params: 3, frame: 19
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SURVEY_HIDE', key: a0});
|
|
const defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport2.track;
|
|
if (a1) {
|
|
Reflect.apply(track, defaultImport2, [AnalyticEvents.APP_NOTICE_CLOSED, {notice_type: NoticeTypes.SURVEY,
|
|
survey_id: a0, dismissed: a1}]);
|
|
} else {
|
|
Reflect.apply(track, defaultImport2, [AnalyticEvents.APP_NOTICE_PRIMARY_CTA_OPENED,
|
|
{notice_type: NoticeTypes.SURVEY}]);
|
|
}
|
|
}
|
|
|
|
function surveyFetch(a0, a1) { // fn#74413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:610, offset: 0x01d8cfb6, size: 177 bytes, params: 3, frame: 18
|
|
const object3 = {};
|
|
if (a0 != null) {
|
|
object3.survey_override = a0;
|
|
}
|
|
if (a1 != null) {
|
|
object3.disable_auto_seen = a1;
|
|
}
|
|
const defaultImport = importDefault(5046) /* metro dependency 5046: TrackedHTTPUtils */;
|
|
const get = defaultImport.get;
|
|
const object4 = {};
|
|
const USER_SURVEY = Endpoints.USER_SURVEY;
|
|
object4.url = USER_SURVEY;
|
|
object4.query = object3;
|
|
const NetworkActionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).NetworkActionNames;
|
|
const USER_SURVEY_FETCH = NetworkActionNames.USER_SURVEY_FETCH;
|
|
object4.trackedActionData = {event: USER_SURVEY_FETCH, properties: function(a0) {
|
|
var r4;
|
|
var value = undefined;
|
|
r4 = a0 == null || a0.body == null ? value : a0.body.survey;
|
|
var moduleValue = require(dependencyMap[6]);
|
|
return moduleValue.exact({key: r4 == null ? value : r4.key});
|
|
}};
|
|
object4.rejectWithError = false;
|
|
return Reflect.apply(get, defaultImport, [object4]).then(_fun74415, _fun74416);
|
|
}
|
|
|
|
function surveySeen(a0) { // fn#74417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:1199, offset: 0x01d8d16b, size: 223 bytes, params: 2, frame: 18
|
|
var object2;
|
|
var defaultImport2;
|
|
var post;
|
|
const NetworkActionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).NetworkActionNames;
|
|
const env0_0 = a0;
|
|
const lastSeenTimestamp = SurveyStore.getLastSeenTimestamp();
|
|
if (lastSeenTimestamp === null) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SURVEY_SEEN', key: a0});
|
|
defaultImport2 = importDefault(5046) /* metro dependency 5046: TrackedHTTPUtils */;
|
|
post = defaultImport2.post;
|
|
object2 = {};
|
|
object2.url = Endpoints.USER_SURVEY_SEEN(a0);
|
|
object2.trackedActionData = {event: NetworkActionNames.USER_SURVEY_SEEN, properties: properties};
|
|
object2.rejectWithError = false;
|
|
return Reflect.apply(post, defaultImport2, [object2]);
|
|
}
|
|
if (lastSeenTimestamp != null) {
|
|
var Date = global.Date;
|
|
if (Date.now() - lastSeenTimestamp >= SURVEY_REFETCH_INTERVAL) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SURVEY_SEEN', key: a0});
|
|
defaultImport2 = importDefault(5046) /* metro dependency 5046: TrackedHTTPUtils */;
|
|
post = defaultImport2.post;
|
|
object2 = {};
|
|
object2.url = Endpoints.USER_SURVEY_SEEN(a0);
|
|
object2.trackedActionData = {event: NetworkActionNames.USER_SURVEY_SEEN, properties: properties};
|
|
object2.rejectWithError = false;
|
|
return Reflect.apply(post, defaultImport2, [object2]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun74415(a0) { // fn#74415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:968, offset: 0x01d8d0c3, size: 117 bytes, params: 2, frame: 17
|
|
let value = environment.__proto__;
|
|
value = undefined;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SURVEY_FETCHED',
|
|
survey: a0 == null || a0.body == null ? value : a0.body.survey});
|
|
return a0 == null || a0.body == null ? value : a0.body.survey;
|
|
}
|
|
|
|
function _fun74416() { // fn#74416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:1123, offset: 0x01d8d138, size: 51 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({'type': 'SURVEY_FETCHED', 'survey': null});
|
|
}
|
|
|
|
function surveySeenProperties() { // fn#74418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9723:1463, owner: surveySeen.properties, offset: 0x01d8d24a, size: 51 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
return (require(1392) /* metro dependency 1392: TypeUtils */).exact({key: env0_0});
|
|
}
|
|
|