decord/alpha/source/actions/ChangeLogActionCreators.tsx

119 lines
3.9 KiB
TypeScript
Raw Normal View History

// Module ID: 8350
// Function ID: 8351
// Name: ChangeLogActionCreators
// Dependencies: [5, 4770, 1074, 2094, 573, 2019, 1271, 2]
2026-07-20 16:05:17 +00:00
// Module 8350 (ChangeLogActionCreators)
import DispatcherDefault from "Dispatcher" /* 573 */;
import HTTPUtils from "HTTPUtils" /* 1271 */;
import UserSettings from "UserSettings" /* 2019 */;
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import ChangelogStore from "ChangelogStore" /* 4770 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-20 16:05:17 +00:00
function cacheBustParam() {
return "x=" + Math.floor(new Date().getMinutes() / 5);
}
const Endpoints = fn(1074).Endpoints;
const ChangelogPlatforms = fn(2094).ChangelogPlatforms;
const size = fn(2);
const result = size.fileFinishedImporting("actions/ChangeLogActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export default {
lockChangeLog(key) {
DispatcherDefault.dispatch({ type: "CHANGE_LOG_LOCK", key });
2026-07-20 16:05:17 +00:00
},
unlockChangeLog(key) {
DispatcherDefault.dispatch({ type: "CHANGE_LOG_UNLOCK", key });
2026-07-20 16:05:17 +00:00
},
markChangelogAsSeen(id, date) {
DispatcherDefault.dispatch({ type: "CHANGE_LOG_MARK_SEEN", changelogId: id, changelogDate: date });
const LastReceivedChangelogId = UserSettings.LastReceivedChangelogId;
LastReceivedChangelogId.updateSetting(id);
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
setChangelogOverride(id) {
DispatcherDefault.dispatch({ type: "CHANGE_LOG_SET_OVERRIDE", id });
2026-07-29 08:29:29 +00:00
if (null != id) {
const self = this;
this.sendChangelogMessage(id);
2026-07-20 16:05:17 +00:00
}
},
sendChangelogMessage(changelog_id) {
const HTTP = HTTPUtils.HTTP;
const request = { url: Endpoints.CHANGELOG_MESSAGES, body: { changelog_id }, rejectWithError: true };
HTTP.post(request);
2026-07-20 16:05:17 +00:00
},
fetchChangelogConfig() {
const HTTP = HTTPUtils.HTTP;
2026-08-24 06:08:38 +00:00
const obj = { url: "https://cdn.discordapp.com/changelogs/config_" + ChangelogPlatforms.MOBILE + ".json?" + "x=" + Math.floor(new Date().getMinutes() / 5), rejectWithError: true };
2026-07-29 08:29:29 +00:00
return HTTP.get(obj);
2026-07-20 16:05:17 +00:00
},
fetchChangelog(arg0, locale, arg2) {
closure_0 = arg0;
closure_1 = locale;
2026-07-20 16:05:17 +00:00
let flag = arg2;
if (arg2 === undefined) {
flag = false;
}
2026-07-29 08:29:29 +00:00
let flag2 = arg3;
if (arg3 === undefined) {
2026-07-20 16:05:17 +00:00
flag2 = false;
}
2026-07-23 10:11:24 +00:00
const self = this;
return flag2(function*(arg0, value) {
if (null != changelog.getChangelog(closure_0, tmp3)) {
2026-08-04 21:03:28 +00:00
return null;
}
if (flag) {
let MOBILE = tmp47.DESKTOP;
2026-08-04 21:03:28 +00:00
} else {
MOBILE = tmp47.MOBILE;
2026-08-04 21:03:28 +00:00
}
let str = "";
if (!flag2) {
2026-08-04 21:03:28 +00:00
const _HermesInternal = HermesInternal;
str = "?" + cacheBustParam();
2026-08-04 21:03:28 +00:00
}
const HTTP = closure_0(1271).HTTP;
2026-08-04 21:03:28 +00:00
const _HermesInternal2 = HermesInternal;
yield HTTP.get({ url: "https://cdn.discordapp.com/changelogs/" + MOBILE + "/" + closure_0 + "/" + tmp3 + ".json" + str, rejectWithError: true });
2026-08-04 21:03:28 +00:00
if (1 === tmp7) {
dependencyMap = 0;
tmp3(573).dispatch({ type: "CHANGE_LOG_FETCH_FAILED", id: closure_129_0, locale: closure_129_1 });
2026-08-04 21:03:28 +00:00
let tmp8 = null;
if ("en-US" !== closure_129_1) {
2026-08-04 21:03:28 +00:00
c3 = 3;
changelog = 1;
return { value: closure_129_4.fetchChangelog(closure_129_0, "en-US"), done: false };
2026-08-04 21:03:28 +00:00
}
tmp3(573);
2026-08-04 21:03:28 +00:00
} else if (2 === tmp7) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
changelog = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
2026-08-04 21:03:28 +00:00
dependencyMap = 0;
changelog = 3;
return { value, done: true };
2026-07-29 08:29:29 +00:00
} else {
closure_128_0 = value;
tmp3(573).dispatch({ type: "CHANGE_LOG_FETCH_SUCCESS", id: closure_129_0, changelog: closure_128_0.body });
2026-08-04 21:03:28 +00:00
dependencyMap = 0;
changelog = 3;
return { value: closure_128_0.body, done: true };
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
} else if (arg0 === 1) {
changelog = 3;
throw value;
2026-07-20 16:05:17 +00:00
} else {
tmp8 = value;
2026-08-04 21:03:28 +00:00
if (arg0 === 2) {
changelog = 3;
return { value, done: true };
2026-07-20 16:05:17 +00:00
}
}
2026-08-04 21:03:28 +00:00
return tmp8;
2026-07-20 16:05:17 +00:00
})();
}
};