decord/source/modules/notifications/settings/NotifSettingsActionCreators.tsx

62 lines
2.3 KiB
TypeScript
Raw Normal View History

// Module ID: 16018
// Function ID: 16019
// Name: NotifSettingsActionCreators
// Dependencies: [13769, 13770, 573, 2]
2026-09-02 09:53:35 +00:00
// Exports: updateNotifSettingRadioValue, updateNotifSettingToggleValue
// Module 16018 (NotifSettingsActionCreators)
import DispatcherDefault from "Dispatcher" /* 573 */;
import notification_settings from "notification_settings" /* 13770 */;
import NotifSettingsProtoStore from "NotifSettingsProtoStore" /* 13769 */;
2026-09-02 09:53:35 +00:00
require = fn;
2026-09-02 09:53:35 +00:00
function updateNotifSettingValue(GAMING_DEFAULT, createNew) {
createNew = createNew.createNew;
const settings = NotifSettingsProtoStore.settings;
2026-09-02 09:53:35 +00:00
if (null != settings.values[GAMING_DEFAULT]) {
const DeclarativeNotifSetting2 = notification_settings.DeclarativeNotifSetting;
2026-09-02 09:53:35 +00:00
let cloneResult = DeclarativeNotifSetting2.clone(tmp);
} else {
cloneResult = undefined;
if (createNew != null) {
cloneResult = createNew();
}
if (cloneResult == null) {
const DeclarativeNotifSetting = notification_settings.DeclarativeNotifSetting;
2026-09-02 09:53:35 +00:00
cloneResult = DeclarativeNotifSetting.create();
}
}
if (createNew.update(cloneResult)) {
const DeclarativeSettings = notification_settings.DeclarativeSettings;
2026-09-02 09:53:35 +00:00
const cloneResult1 = DeclarativeSettings.clone(settings);
cloneResult1.values[GAMING_DEFAULT] = cloneResult;
const obj2 = { type: "DECLARATIVE_NOTIFICATION_SETTINGS_UPDATE", declarativeSettings: cloneResult1 };
DispatcherDefault.dispatch(obj2);
2026-09-02 09:53:35 +00:00
}
}
const size = fn(2);
const result = size.fileFinishedImporting("modules/notifications/settings/NotifSettingsActionCreators.tsx");
2026-09-02 09:53:35 +00:00
export const updateNotifSettingToggleValue = function updateNotifSettingToggleValue(GAMING_DEFAULT, toggle) {
2026-09-02 09:53:35 +00:00
updateNotifSettingValue(GAMING_DEFAULT, {
createNew() {
const DeclarativeNotifSetting = toggle(dependencyMap[1]).DeclarativeNotifSetting;
2026-09-02 09:53:35 +00:00
const obj = DeclarativeNotifSetting.create();
obj.toggle = true;
return obj;
},
update(toggle) {
toggle.toggle = toggle;
return toggle.toggle !== toggle;
2026-09-02 09:53:35 +00:00
}
});
};
export const updateNotifSettingRadioValue = function updateNotifSettingRadioValue(GAMING_DEFAULT, radio) {
2026-09-02 09:53:35 +00:00
updateNotifSettingValue(GAMING_DEFAULT, {
update(radio) {
radio.radio = radio;
return radio.radio !== radio;
2026-09-02 09:53:35 +00:00
}
});
};