decord/source/modules/notifications/NotificationUtils.tsx

99 lines
3.8 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 10315
// Function ID: 79640
2026-07-20 16:05:17 +00:00
// Name: getMuteTimeOptions
2026-07-23 10:11:24 +00:00
// Dependencies: [4325, 653, 662, 1212, 21, 1360, 3761, 566, 2]
2026-07-20 16:05:17 +00:00
// Exports: filterOverrides, getMuteTimeOptions, shouldShowUseNewNotificationSystem, useShouldUseNewNotificationSystem
2026-07-24 07:16:23 +00:00
// Module 10315 (getMuteTimeOptions)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { UserNotificationSettings } from "ME";
import MAX_FAVORITES from "MAX_FAVORITES";
let closure_6;
let closure_7;
const require = arg1;
({ MuteUntilSeconds: closure_6, ChannelNotificationSettingsFlags: closure_7 } = MAX_FAVORITES);
let closure_8 = { ignoreMute: false, ignoreUnreadSetting: true, ignoreNotificationSetting: false };
const result = require("MAX_FAVORITES").fileFinishedImporting("modules/notifications/NotificationUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getMuteTimeOptions = function getMuteTimeOptions() {
let obj = { id: "15-minutes" };
2026-07-23 10:11:24 +00:00
const intl = require(1212) /* getSystemLocale */.intl;
obj.label = intl.string(require(1212) /* getSystemLocale */.t["8ot6gv"]);
2026-07-20 16:05:17 +00:00
obj.value = closure_6.MINUTES_15;
const items = [obj, , , , , ];
obj = { id: "1-hour" };
2026-07-23 10:11:24 +00:00
const intl2 = require(1212) /* getSystemLocale */.intl;
obj.label = intl2.string(require(1212) /* getSystemLocale */.t.UMWBZr);
2026-07-20 16:05:17 +00:00
obj.value = closure_6.HOURS_1;
items[1] = obj;
obj = { id: "3-hours" };
2026-07-23 10:11:24 +00:00
const intl3 = require(1212) /* getSystemLocale */.intl;
obj.label = intl3.string(require(1212) /* getSystemLocale */.t.QmYWtu);
2026-07-20 16:05:17 +00:00
obj.value = closure_6.HOURS_3;
items[2] = obj;
const obj1 = { id: "8-hours" };
2026-07-23 10:11:24 +00:00
const intl4 = require(1212) /* getSystemLocale */.intl;
obj1.label = intl4.string(require(1212) /* getSystemLocale */.t.EpAXPC);
2026-07-20 16:05:17 +00:00
obj1.value = closure_6.HOURS_8;
items[3] = obj1;
const obj2 = { id: "24-hours" };
2026-07-23 10:11:24 +00:00
const intl5 = require(1212) /* getSystemLocale */.intl;
obj2.label = intl5.string(require(1212) /* getSystemLocale */.t["755t4q"]);
2026-07-20 16:05:17 +00:00
obj2.value = closure_6.HOURS_24;
items[4] = obj2;
const obj3 = { id: "forever" };
2026-07-23 10:11:24 +00:00
const intl6 = require(1212) /* getSystemLocale */.intl;
obj3.label = intl6.string(require(1212) /* getSystemLocale */.t.r3LawO);
2026-07-20 16:05:17 +00:00
obj3.value = closure_6.ALWAYS;
items[5] = obj3;
return items;
};
export const filterOverrides = function filterOverrides(channelOverrides, arg1) {
let tmp = arg1;
2026-07-23 10:11:24 +00:00
let closure_0 = channelOverrides;
2026-07-20 16:05:17 +00:00
if (arg1 === undefined) {
tmp = closure_8;
}
const importDefault = tmp;
2026-07-23 10:11:24 +00:00
const keys = importDefault(21).keys(channelOverrides);
2026-07-20 16:05:17 +00:00
return keys.filter((arg0) => {
2026-07-23 10:11:24 +00:00
const flags = dependencyMap[arg0].flags;
2026-07-20 16:05:17 +00:00
let num = 0;
if (null != flags) {
num = flags;
}
2026-07-23 10:11:24 +00:00
let hasFlagResult = outer1_2(outer1_3[5]).hasFlag(num, outer1_7.UNREADS_ALL_MESSAGES);
2026-07-20 16:05:17 +00:00
if (!hasFlagResult) {
2026-07-23 10:11:24 +00:00
const flags2 = dependencyMap[arg0].flags;
2026-07-20 16:05:17 +00:00
let num2 = 0;
if (null != flags2) {
num2 = flags2;
}
2026-07-23 10:11:24 +00:00
hasFlagResult = outer1_2(outer1_3[5]).hasFlag(num2, outer1_7.UNREADS_ONLY_MENTIONS);
const obj2 = outer1_2(outer1_3[5]);
2026-07-20 16:05:17 +00:00
}
let tmp7 = !tmp.ignoreUnreadSetting && hasFlagResult;
if (!tmp7) {
tmp7 = !tmp.ignoreNotificationSetting && tmp;
const tmp9 = !tmp.ignoreNotificationSetting && tmp;
}
if (!tmp7) {
let isMuted = !tmp.ignoreMute;
if (isMuted) {
2026-07-23 10:11:24 +00:00
isMuted = dependencyMap(outer1_3[6]).computeIsMuted(dependencyMap[arg0]);
const obj3 = dependencyMap(outer1_3[6]);
2026-07-20 16:05:17 +00:00
}
tmp7 = isMuted;
}
return tmp7;
});
};
export const useShouldUseNewNotificationSystem = function useShouldUseNewNotificationSystem(GuildUnreadAction) {
2026-07-23 10:11:24 +00:00
const items = [_isNativeReflectConstruct];
return require(566) /* initialize */.useStateFromStores(items, () => outer1_4.useNewNotifications);
2026-07-20 16:05:17 +00:00
};
export const shouldShowUseNewNotificationSystem = function shouldShowUseNewNotificationSystem(GuildPopoutMenu) {
return useNewNotifications.useNewNotifications;
};