decord/source/modules/polls/useTrackPollEvents.tsx
github-actions ecf26fc058 chore: update source for alpha 347.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
2026-09-16 07:03:15 +00:00

41 lines
1.6 KiB
TypeScript

// Module ID: 12349
// Function ID: 12350
// Name: useTrackPollEvents
// Dependencies: [19, 1074, 4818, 11862, 2]
// Exports: useTrackPollCreationEvents
// Module 12349 (useTrackPollEvents)
import AppAnalyticsUtilsDefault from "AppAnalyticsUtils" /* 4818 */;
import PollLayoutTypes from "PollLayoutTypes" /* 11862 */;
import noop from "module_19" /* 19 */;
require = fn;
const AnalyticEvents = fn(1074).AnalyticEvents;
const size = fn(2);
const result = size.fileFinishedImporting("modules/polls/useTrackPollEvents.tsx");
export const useTrackPollCreationEvents = function useTrackPollCreationEvents(answers, allowMultiSelect) {
let attachments_count = answers;
let obj = { trackPollCreationCancelled: null };
const items = [answers, allowMultiSelect];
obj.trackPollCreationCancelled = noop.useCallback(() => {
attachments_count = 0;
allowMultiSelect = 0;
stickers_count = 0;
const item = attachments_count.forEach((image) => {
image = image.image;
if (null != image) {
if (null != image.emoji) {
closure_1 = closure_1 + 1;
} else if (null != image.stickerId) {
closure_2 = closure_2 + 1;
} else if (null != image.mediaAttachmentState) {
closure_0 = closure_0 + 1;
}
}
});
const obj = AppAnalyticsUtilsDefault;
obj.trackWithMetadata(AnalyticEvents.POLL_CREATION_CANCELLED, { answers_count: attachments_count.length, attachments_count, emojis_count: allowMultiSelect, stickers_count, allow_multiselect: allowMultiSelect, layout_type: PollLayoutTypes.PollLayoutTypes.DEFAULT });
}, items);
return obj;
};