decord/source/modules/notifications/settings/utils/notificationSettingsPresetUtils.tsx

82 lines
3.8 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 4329
2026-07-27 11:26:19 +00:00
// Function ID: 38015
2026-07-20 16:05:17 +00:00
// Name: Presets
2026-07-25 08:10:48 +00:00
// Dependencies: [653, 4327, 4330, 1212, 2]
2026-07-20 16:05:17 +00:00
// Exports: arePresetSettingsUnset, presetFromSettings, presetName
2026-07-25 08:10:48 +00:00
// Module 4329 (Presets)
2026-07-23 10:11:24 +00:00
import { UserNotificationSettings } from "ME";
import { UnreadSetting } from "ReadStateTypes";
2026-07-20 16:05:17 +00:00
const obj = { ALL_MESSAGES: "all_messages", MENTIONS: "mentions", NOTHING: "nothing", CUSTOM: "custom" };
2026-07-23 10:11:24 +00:00
const result = require("n").fileFinishedImporting("modules/notifications/settings/utils/notificationSettingsPresetUtils.tsx");
2026-07-20 16:05:17 +00:00
export const Presets = obj;
export const presetFromSettings = function presetFromSettings(unreadSetting, messageNotifications) {
const items = [messageNotifications, unreadSetting];
2026-07-25 08:10:48 +00:00
const match = require(4330) /* n */.match(items);
2026-07-20 16:05:17 +00:00
const items1 = [UserNotificationSettings.ALL_MESSAGES, UnreadSetting.ALL_MESSAGES];
2026-07-25 08:10:48 +00:00
const str = require(4330) /* n */;
2026-07-20 16:05:17 +00:00
const items2 = [UserNotificationSettings.ONLY_MENTIONS, UnreadSetting.UNSET];
2026-07-23 10:11:24 +00:00
const withResult = match.with(items1, () => outer1_4.ALL_MESSAGES);
2026-07-20 16:05:17 +00:00
const items3 = [UserNotificationSettings.ONLY_MENTIONS, UnreadSetting.ONLY_MENTIONS];
2026-07-23 10:11:24 +00:00
const withResult1 = match.with(items1, () => outer1_4.ALL_MESSAGES).with(items2, () => outer1_4.MENTIONS);
2026-07-20 16:05:17 +00:00
const items4 = [UserNotificationSettings.NO_MESSAGES, UnreadSetting.UNSET];
2026-07-23 10:11:24 +00:00
const withResult2 = match.with(items1, () => outer1_4.ALL_MESSAGES).with(items2, () => outer1_4.MENTIONS).with(items3, () => outer1_4.MENTIONS);
2026-07-20 16:05:17 +00:00
const items5 = [UserNotificationSettings.NO_MESSAGES, UnreadSetting.ONLY_MENTIONS];
2026-07-23 10:11:24 +00:00
const withResult3 = match.with(items1, () => outer1_4.ALL_MESSAGES).with(items2, () => outer1_4.MENTIONS).with(items3, () => outer1_4.MENTIONS).with(items4, () => outer1_4.NOTHING);
return match.with(items1, () => outer1_4.ALL_MESSAGES).with(items2, () => outer1_4.MENTIONS).with(items3, () => outer1_4.MENTIONS).with(items4, () => outer1_4.NOTHING).with(items5, () => outer1_4.NOTHING).otherwise(() => outer1_4.CUSTOM);
2026-07-20 16:05:17 +00:00
};
export const presetName = function presetName(arg0) {
2026-07-25 08:10:48 +00:00
const match = require(4330) /* n */.match(arg0);
const str = require(4330) /* n */;
2026-07-20 16:05:17 +00:00
const withResult = match.with(obj.ALL_MESSAGES, () => {
2026-07-23 10:11:24 +00:00
const intl = outer1_0(outer1_1[3]).intl;
return intl.string(outer1_0(outer1_1[3]).t.hZrr6k);
2026-07-20 16:05:17 +00:00
});
const withResult1 = match.with(obj.ALL_MESSAGES, () => {
2026-07-23 10:11:24 +00:00
const intl = outer1_0(outer1_1[3]).intl;
return intl.string(outer1_0(outer1_1[3]).t.hZrr6k);
2026-07-20 16:05:17 +00:00
}).with(obj.MENTIONS, () => {
2026-07-23 10:11:24 +00:00
const intl = outer1_0(outer1_1[3]).intl;
return intl.string(outer1_0(outer1_1[3]).t.y59NJm);
2026-07-20 16:05:17 +00:00
});
const withResult2 = match.with(obj.ALL_MESSAGES, () => {
2026-07-23 10:11:24 +00:00
const intl = outer1_0(outer1_1[3]).intl;
return intl.string(outer1_0(outer1_1[3]).t.hZrr6k);
2026-07-20 16:05:17 +00:00
}).with(obj.MENTIONS, () => {
2026-07-23 10:11:24 +00:00
const intl = outer1_0(outer1_1[3]).intl;
return intl.string(outer1_0(outer1_1[3]).t.y59NJm);
2026-07-20 16:05:17 +00:00
}).with(obj.NOTHING, () => {
2026-07-23 10:11:24 +00:00
const intl = outer1_0(outer1_1[3]).intl;
return intl.string(outer1_0(outer1_1[3]).t["pGn/bJ"]);
2026-07-20 16:05:17 +00:00
});
return match.with(obj.ALL_MESSAGES, () => {
2026-07-23 10:11:24 +00:00
const intl = outer1_0(outer1_1[3]).intl;
return intl.string(outer1_0(outer1_1[3]).t.hZrr6k);
2026-07-20 16:05:17 +00:00
}).with(obj.MENTIONS, () => {
2026-07-23 10:11:24 +00:00
const intl = outer1_0(outer1_1[3]).intl;
return intl.string(outer1_0(outer1_1[3]).t.y59NJm);
2026-07-20 16:05:17 +00:00
}).with(obj.NOTHING, () => {
2026-07-23 10:11:24 +00:00
const intl = outer1_0(outer1_1[3]).intl;
return intl.string(outer1_0(outer1_1[3]).t["pGn/bJ"]);
2026-07-20 16:05:17 +00:00
}).with(obj.CUSTOM, () => {
2026-07-23 10:11:24 +00:00
const intl = outer1_0(outer1_1[3]).intl;
return intl.string(outer1_0(outer1_1[3]).t["32yow9"]);
2026-07-20 16:05:17 +00:00
}).exhaustive();
};
export const arePresetSettingsUnset = function arePresetSettingsUnset(arg0, arg1) {
let tmp = null != arg0;
if (tmp) {
tmp = arg0 !== UnreadSetting.UNSET;
}
if (!tmp) {
let tmp3 = null != arg1;
if (tmp3) {
tmp3 = arg1 !== UserNotificationSettings.NULL;
}
tmp = tmp3;
}
return !tmp;
};