decord/source/modules/self_mod/ChannelSafetyWarningsActionCreators.tsx
github-actions 20a21ad13f chore: update source for alpha 346.5
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4791.js (118.4 MB)
2026-09-11 19:12:58 +00:00

44 lines
2.6 KiB
TypeScript

// Module ID: 11465
// Function ID: 11466
// Name: ChannelSafetyWarningsActionCreators
// Dependencies: [11007, 1074, 573, 1272, 2]
// Exports: acknowledgeChannelSafetyWarningTooltip, clearChannelSafetyWarnings, dismissChannelSafetyWarnings, markAsStrangerDanger, reportFalsePositive, setChannelSafetyWarningFeedback
// Module 11465 (ChannelSafetyWarningsActionCreators)
import DispatcherDefault from "Dispatcher" /* 573 */;
import Constants from "Constants" /* 1074 */;
import HTTPUtils from "HTTPUtils" /* 1272 */;
import ChannelSafetyWarningsStore from "ChannelSafetyWarningsStore" /* 11007 */;
import size from "module_2" /* 2 */;
const SafetyWarningTypes = ChannelSafetyWarningsStore.SafetyWarningTypes;
const Endpoints = Constants.Endpoints;
const result = size.fileFinishedImporting("modules/self_mod/ChannelSafetyWarningsActionCreators.tsx");
export const dismissChannelSafetyWarnings = function dismissChannelSafetyWarnings(channelId, items) {
DispatcherDefault.dispatch({ type: "DISMISS_CHANNEL_SAFETY_WARNINGS", channelId, warningIds: items });
const HTTP = HTTPUtils.HTTP;
const request = { url: Endpoints.CHANNEL_SAFETY_WARNINGS_ACK(channelId), body: { warning_ids: items }, oldFormErrors: true, rejectWithError: null };
const obj2 = { type: "DISMISS_CHANNEL_SAFETY_WARNINGS", channelId, warningIds: items };
request.rejectWithError = HTTPUtils.rejectWithMigratedError();
return HTTP.post(request);
};
export const setChannelSafetyWarningFeedback = function setChannelSafetyWarningFeedback(channelId, warningId, feedbackType) {
DispatcherDefault.dispatch({ type: "CHANNEL_SAFETY_WARNING_FEEDBACK", channelId, warningId, feedbackType });
};
export const clearChannelSafetyWarnings = function clearChannelSafetyWarnings(channelId) {
DispatcherDefault.dispatch({ type: "CLEAR_CHANNEL_SAFETY_WARNINGS", channelId });
};
export const acknowledgeChannelSafetyWarningTooltip = function acknowledgeChannelSafetyWarningTooltip(channelId) {
DispatcherDefault.dispatch({ type: "ACKNOWLEDGE_CHANNEL_SAFETY_WARNING_TOOLTIP", channelId });
};
export const reportFalsePositive = function reportFalsePositive(arg0) {
const HTTP = HTTPUtils.HTTP;
const obj = { url: Endpoints.SAFETY_WARNING_FALSE_POSITIVE(arg0), rejectWithError: HTTPUtils.rejectWithMigratedError() };
return HTTP.post(obj);
};
export const markAsStrangerDanger = function markAsStrangerDanger(id) {
const HTTP = HTTPUtils.HTTP;
const request = { url: Endpoints.ADD_SAFETY_WARNING(id), body: { safety_warning_type: SafetyWarningTypes.STRANGER_DANGER }, rejectWithError: HTTPUtils.rejectWithMigratedError() };
return HTTP.post(request);
};