decord/stable/source/modules/scheduled_messages/ScheduledMessageNotifications.native.tsx
github-actions 528a3dd5ba chore: update source for stable 345.9
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4745.js (118.4 MB)
2026-09-18 20:18:48 +00:00

125 lines
6.3 KiB
TypeScript

// Module ID: 7848
// Function ID: 7849
// Name: ScheduledMessageNotifications
// Dependencies: [1074, 4259, 1114, 4523, 6616, 7845, 7849, 7182, 4904, 4763, 12216, 1896, 2]
// Exports: handleScheduleMessageError, showScheduleMessageDeleteFailureToast, showScheduleMessageDeleteSuccessToast, showScheduleMessageFailureToast, showScheduleMessageSentNowFailureToast, showScheduleMessageSentNowSuccessToast, showScheduleMessageSuccessToast, showScheduledMessageEditFailureToast, showScheduledMessageEditSuccessToast
// Module 7848 (ScheduledMessageNotifications)
import Constants from "Constants" /* 1074 */;
import util from "util" /* 1114 */;
import ToastActionCreatorsDefault from "ToastActionCreators" /* 4259 */;
import ClockIcon from "ClockIcon" /* 4523 */;
import CircleXIcon from "CircleXIcon" /* 6616 */;
import ScheduledMessageUtils from "ScheduledMessageUtils" /* 7845 */;
import size from "module_2" /* 2 */;
const require = globalThis.__r;
const AbortCodes = Constants.AbortCodes;
const result = size.fileFinishedImporting("modules/scheduled_messages/ScheduledMessageNotifications.native.tsx");
export const showScheduleMessageSuccessToast = function showScheduleMessageSuccessToast(arg0) {
const obj2 = { key: "SCHEDULED_MESSAGE_CREATE_SUCCESS", content: null, IconComponent: null, iconColor: "status-positive" };
const intl = util.intl;
const obj3 = { timestamp: null };
const obj = ToastActionCreatorsDefault;
obj3.timestamp = new Date(arg0).valueOf();
obj2.content = intl.formatToPlainString(util.t["CvHu/j"], obj3);
obj2.IconComponent = ClockIcon.ClockIcon;
obj.open(obj2);
};
export const showScheduleMessageFailureToast = function showScheduleMessageFailureToast(error) {
const obj2 = { key: "SCHEDULED_MESSAGE_CREATE_FAILURE", content: null, IconComponent: null, iconColor: "icon-feedback-critical" };
const intl = util.intl;
obj2.content = intl.formatToPlainString(util.t.PsJmUe, { error });
obj2.IconComponent = CircleXIcon.CircleXIcon;
ToastActionCreatorsDefault.open(obj2);
};
export const handleScheduleMessageError = function handleScheduleMessageError(body) {
body = body.body;
let code;
if (body != null) {
code = body.code;
}
if (code === AbortCodes.TOO_MANY_SCHEDULED_MESSAGES) {
const scheduledMessagesLimit = ScheduledMessageUtils.getScheduledMessagesLimit("ScheduledMessagesCreateRoadblock");
if (scheduledMessagesLimit.isUpgradable) {
const items = [tmp11(7182).SCHEDULED_MESSAGES_ROADBLOCK];
tmp11(7849)(items);
const tmp11Result = tmp11(7849);
} else {
const obj2 = { title: null, body: null, confirmText: null, cancelText: null, onCancel: null };
const intl2 = tmp7(1114).intl;
obj2.title = intl2.string(tmp7(1114).t.RLdUVh);
const intl3 = tmp7(1114).intl;
const obj3 = { max: tmp10 };
obj2.body = intl3.formatToPlainString(tmp7(1114).t["3AMt7r"], obj3);
const intl4 = tmp7(1114).intl;
obj2.confirmText = intl4.string(tmp7(1114).t.BddRzS);
const intl5 = tmp7(1114).intl;
obj2.cancelText = intl5.string(tmp7(1114).t.lv6bDa);
obj2.onCancel = function onCancel() {
return require("ModalActionCreators").pushLazy(require("asyncRequireImpl")(paths[10], paths.paths), {}, "scheduled-messages-modal", { presentation: "modal" });
};
tmp11(4904).show(obj2);
const tmp11Result2 = tmp11(4904);
}
} else {
const body2 = body.body;
let message;
if (body2 != null) {
message = body2.message;
}
if (message == null) {
message = body.message;
}
const obj5 = { key: "SCHEDULED_MESSAGE_CREATE_FAILURE", content: null, IconComponent: null, iconColor: "icon-feedback-critical" };
const intl = util.intl;
const obj6 = { error: message };
obj5.content = intl.formatToPlainString(util.t.PsJmUe, obj6);
obj5.IconComponent = CircleXIcon.CircleXIcon;
ToastActionCreatorsDefault.open(obj5);
}
};
export const showScheduledMessageEditSuccessToast = function showScheduledMessageEditSuccessToast() {
const obj2 = { key: "SCHEDULED_MESSAGE_UPDATE_SUCCESS", content: null, IconComponent: null, iconColor: "status-positive" };
const intl = util.intl;
obj2.content = intl.string(util.t.MXsMRk);
obj2.IconComponent = ClockIcon.ClockIcon;
ToastActionCreatorsDefault.open(obj2);
};
export const showScheduledMessageEditFailureToast = function showScheduledMessageEditFailureToast(message) {
const obj2 = { key: "SCHEDULED_MESSAGE_UPDATE_FAILURE", content: null, IconComponent: null, iconColor: "icon-feedback-critical" };
const intl = util.intl;
obj2.content = intl.formatToPlainString(util.t.slM6In, { error: message });
obj2.IconComponent = CircleXIcon.CircleXIcon;
ToastActionCreatorsDefault.open(obj2);
};
export const showScheduleMessageDeleteSuccessToast = function showScheduleMessageDeleteSuccessToast() {
const obj2 = { key: "SCHEDULED_MESSAGE_DELETE_SUCCESS", content: null, IconComponent: null, iconColor: "status-positive" };
const intl = util.intl;
obj2.content = intl.string(util.t["JF/LWn"]);
obj2.IconComponent = ClockIcon.ClockIcon;
ToastActionCreatorsDefault.open(obj2);
};
export const showScheduleMessageDeleteFailureToast = function showScheduleMessageDeleteFailureToast(message) {
const obj2 = { key: "SCHEDULED_MESSAGE_DELETE_FAILURE", content: null, IconComponent: null, iconColor: "icon-feedback-critical" };
const intl = util.intl;
obj2.content = intl.formatToPlainString(util.t.sUvyW3, { error: message });
obj2.IconComponent = CircleXIcon.CircleXIcon;
ToastActionCreatorsDefault.open(obj2);
};
export const showScheduleMessageSentNowSuccessToast = function showScheduleMessageSentNowSuccessToast() {
const obj2 = { key: "SCHEDULED_MESSAGE_SEND_NOW_SUCCESS", content: null, IconComponent: null, iconColor: "status-positive" };
const intl = util.intl;
obj2.content = intl.string(util.t["BHCm/d"]);
obj2.IconComponent = ClockIcon.ClockIcon;
ToastActionCreatorsDefault.open(obj2);
};
export const showScheduleMessageSentNowFailureToast = function showScheduleMessageSentNowFailureToast(message) {
const obj2 = { key: "SCHEDULED_MESSAGE_SEND_NOW_FAILURE", content: null, IconComponent: null, iconColor: "icon-feedback-critical" };
const intl = util.intl;
obj2.content = intl.formatToPlainString(util.t["uy++C+"], { error: message });
obj2.IconComponent = CircleXIcon.CircleXIcon;
ToastActionCreatorsDefault.open(obj2);
};