Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4941.js (118.4 MB)
118 lines
3.9 KiB
TypeScript
118 lines
3.9 KiB
TypeScript
// Module ID: 8350
|
|
// Function ID: 8351
|
|
// Name: ChangeLogActionCreators
|
|
// Dependencies: [5, 4770, 1074, 2094, 573, 2019, 1271, 2]
|
|
|
|
// 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 */;
|
|
|
|
require = fn;
|
|
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");
|
|
|
|
export default {
|
|
lockChangeLog(key) {
|
|
DispatcherDefault.dispatch({ type: "CHANGE_LOG_LOCK", key });
|
|
},
|
|
unlockChangeLog(key) {
|
|
DispatcherDefault.dispatch({ type: "CHANGE_LOG_UNLOCK", key });
|
|
},
|
|
markChangelogAsSeen(id, date) {
|
|
DispatcherDefault.dispatch({ type: "CHANGE_LOG_MARK_SEEN", changelogId: id, changelogDate: date });
|
|
const LastReceivedChangelogId = UserSettings.LastReceivedChangelogId;
|
|
LastReceivedChangelogId.updateSetting(id);
|
|
},
|
|
setChangelogOverride(id) {
|
|
DispatcherDefault.dispatch({ type: "CHANGE_LOG_SET_OVERRIDE", id });
|
|
if (null != id) {
|
|
const self = this;
|
|
this.sendChangelogMessage(id);
|
|
}
|
|
},
|
|
sendChangelogMessage(changelog_id) {
|
|
const HTTP = HTTPUtils.HTTP;
|
|
const request = { url: Endpoints.CHANGELOG_MESSAGES, body: { changelog_id }, rejectWithError: true };
|
|
HTTP.post(request);
|
|
},
|
|
fetchChangelogConfig() {
|
|
const HTTP = HTTPUtils.HTTP;
|
|
const obj = { url: "https://cdn.discordapp.com/changelogs/config_" + ChangelogPlatforms.MOBILE + ".json?" + "x=" + Math.floor(new Date().getMinutes() / 5), rejectWithError: true };
|
|
return HTTP.get(obj);
|
|
},
|
|
fetchChangelog(arg0, locale, arg2) {
|
|
closure_0 = arg0;
|
|
closure_1 = locale;
|
|
let flag = arg2;
|
|
if (arg2 === undefined) {
|
|
flag = false;
|
|
}
|
|
let flag2 = arg3;
|
|
if (arg3 === undefined) {
|
|
flag2 = false;
|
|
}
|
|
const self = this;
|
|
return flag2(function*(arg0, value) {
|
|
if (null != changelog.getChangelog(closure_0, tmp3)) {
|
|
return null;
|
|
}
|
|
if (flag) {
|
|
let MOBILE = tmp47.DESKTOP;
|
|
} else {
|
|
MOBILE = tmp47.MOBILE;
|
|
}
|
|
let str = "";
|
|
if (!flag2) {
|
|
const _HermesInternal = HermesInternal;
|
|
str = "?" + cacheBustParam();
|
|
}
|
|
const HTTP = closure_0(1271).HTTP;
|
|
const _HermesInternal2 = HermesInternal;
|
|
yield HTTP.get({ url: "https://cdn.discordapp.com/changelogs/" + MOBILE + "/" + closure_0 + "/" + tmp3 + ".json" + str, rejectWithError: true });
|
|
if (1 === tmp7) {
|
|
dependencyMap = 0;
|
|
tmp3(573).dispatch({ type: "CHANGE_LOG_FETCH_FAILED", id: closure_129_0, locale: closure_129_1 });
|
|
let tmp8 = null;
|
|
if ("en-US" !== closure_129_1) {
|
|
c3 = 3;
|
|
changelog = 1;
|
|
return { value: closure_129_4.fetchChangelog(closure_129_0, "en-US"), done: false };
|
|
}
|
|
tmp3(573);
|
|
} else if (2 === tmp7) {
|
|
if (arg0 === 1) {
|
|
changelog = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
dependencyMap = 0;
|
|
changelog = 3;
|
|
return { value, done: true };
|
|
} else {
|
|
closure_128_0 = value;
|
|
tmp3(573).dispatch({ type: "CHANGE_LOG_FETCH_SUCCESS", id: closure_129_0, changelog: closure_128_0.body });
|
|
dependencyMap = 0;
|
|
changelog = 3;
|
|
return { value: closure_128_0.body, done: true };
|
|
}
|
|
} else if (arg0 === 1) {
|
|
changelog = 3;
|
|
throw value;
|
|
} else {
|
|
tmp8 = value;
|
|
if (arg0 === 2) {
|
|
changelog = 3;
|
|
return { value, done: true };
|
|
}
|
|
}
|
|
return tmp8;
|
|
})();
|
|
}
|
|
};
|