Files
discord-decomp/sources/actions/ChangeLogActionCreators.tsx
2026-07-28 01:06:53 +03:00

686 lines
29 KiB
TypeScript

/* Metro module 8338; source: actions/ChangeLogActionCreators.tsx; dependencies: [5, 4604, 661, 1933, 694, 3829, 507, 2] */
import Module00005 from '../by-id/module-00005.js'; /* Metro dependency 5 */
import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */
import ChangelogStore from '../modules/changelog/ChangelogStore.tsx'; /* Metro dependency 4604 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as HTTPUtilsModule from '../external/discord_common/js/packages/http-utils/HTTPUtils.tsx'; /* Metro dependency 507 */
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
import * as ChangelogConstantsModule from '../modules/changelog/ChangelogConstants.tsx'; /* Metro dependency 1933 */
function _fun66388(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8523:6, offset: 0x01bf9aae, size: 272 bytes, params: 8, frame: 19
const env0_0 = require;
const cacheBustParam = function() {
var value2 = new global.Date();
value2 = value2.getMinutes();
value2 = global.Math.floor(value2 / 5);
return 'x=' + value2;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object = {lockChangeLog: lockChangeLog, unlockChangeLog: unlockChangeLog, markChangelogAsSeen: function(a0, a1) {
importDefault(dependencyMap[4]).dispatch({type: 'CHANGE_LOG_MARK_SEEN', changelogId: a0, changelogDate: a1});
var LastReceivedChangelogId = require(dependencyMap[5]).LastReceivedChangelogId;
LastReceivedChangelogId.updateSetting(a0);
}, setChangelogOverride: setChangelogOverride, sendChangelogMessage: function(a0) {
var HTTP = require(dependencyMap[6]).HTTP;
HTTP.post({url: Endpoints.CHANGELOG_MESSAGES, body: {changelog_id: a0}, rejectWithError: true});
}, fetchChangelogConfig: fetchChangelogConfig, fetchChangelog: fetchChangelog};
(FileImportTrackerModule).fileFinishedImporting('actions/ChangeLogActionCreators.tsx');
exports.default = object;
function lockChangeLog(a0) { // fn#66390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8523:257, offset: 0x01bf9c14, size: 56 bytes, params: 2, frame: 13
(Dispatcher).dispatch({type: 'CHANGE_LOG_LOCK', key: a0});
}
function unlockChangeLog(a0) { // fn#66391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8523:324, offset: 0x01bf9c4c, size: 56 bytes, params: 2, frame: 13
(Dispatcher).dispatch({type: 'CHANGE_LOG_UNLOCK', key: a0});
}
function setChangelogOverride(a0) { // fn#66393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8523:548, offset: 0x01bf9ce6, size: 76 bytes, params: 2, frame: 15
(Dispatcher).dispatch({type: 'CHANGE_LOG_SET_OVERRIDE', id: a0});
if (a0 != null) {
this.sendChangelogMessage(a0);
}
}
function fetchChangelogConfig() { // fn#66395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8523:779, offset: 0x01bf9d81, size: 104 bytes, params: 1, frame: 18
const MOBILE = ChangelogPlatforms.MOBILE;
const HTTP = (HTTPUtilsModule).HTTP;
const get = HTTP.get;
const object = {};
object.url = 'https://cdn.discordapp.com/changelogs/config_' + MOBILE + '.json?' + cacheBustParam();
object.rejectWithError = true;
return Reflect.apply(get, HTTP, [object]);
}
function fetchChangelog(a0, a1) { // fn#66396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8523:945, offset: 0x01bf9de9, size: 76 bytes, params: 3, frame: 13
const value = a2;
const value2 = a3;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = value !== undefined ? value : false;
return (value2 !== undefined ? value2 : false)(_fun66398)();
function* _fun66398() { // fn#66398, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8523:996, offset: 0x01bf9e40, size: 426 bytes, params: 1, frame: 30
var r3;
var concat;
var binding2;
var property;
var value9;
var HTTP;
var get;
var object;
var value10;
var value11;
var value12;
var value13;
var binding3;
var value14;
var dispatch;
var body;
var error;
var changelogStoreBinding;
var fetchChangelog;
var value15;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_4;
const changelog = binding.getChangelog(require, importDefault);
const value5 = null;
if (value5 != changelog) {
return value5;
}
binding = env2_6;
const r4 = dependencyMap ? binding.DESKTOP : binding.MOBILE;
const r42 = env1_3 ? '' : '?' + env2_7();
try {
binding = env2_0;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
binding2 = env2_2;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
property = binding2[6];
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
value9 = binding(property);
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
HTTP = value9.HTTP;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
get = HTTP.get;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
object = {};
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
value10 = Reflect.apply(concat, 'https://cdn.discordapp.com/changelogs/', [r4, '/', require, '/', importDefault,
'.json', r42]);
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
object.url = value10;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
object.rejectWithError = true;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
value11 = Reflect.apply(get, HTTP, [object]);
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
yield value11;
try {
value12 = undefined;
value13 = false;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
if (value13) {
return value12;
}
try {
binding = env2_1;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
binding3 = env2_2;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
property = binding3[4];
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
value14 = binding(property);
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
dispatch = value14.dispatch;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
object = {};
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
object.type = 'CHANGE_LOG_FETCH_SUCCESS';
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
object.id = require;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
body = value12.body;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
object.changelog = body;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
Reflect.apply(dispatch, value14, [object]);
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
try {
body = value12.body;
} catch (error) {
binding = env2_1;
value = binding(env2_2[4]);
value.dispatch({type: 'CHANGE_LOG_FETCH_FAILED', id: require, locale: importDefault});
if (importDefault === 'en-US') {
return value5;
}
changelogStoreBinding = ChangelogStore;
fetchChangelog = changelogStoreBinding.fetchChangelog;
yield Reflect.apply(fetchChangelog, changelogStoreBinding, [require, 'en-US']);
value = undefined;
value15 = false;
if (value15) {
return value;
}
r3 = value;
return r3;
}
return body;
}
}
}
global.__d(_fun66388, 8338, [5, 4604, 661, 1933, 694, 3829, 507,
2]) /* metro module 8338, dependencies: [5, 4604, 661, 1933, 694, 3829, 507, 2] */;