83 lines
5.1 KiB
TypeScript
83 lines
5.1 KiB
TypeScript
/* Metro module 8337; source: modules/changelog/useCurrentChangelog.tsx; dependencies: [31, 1949, 4604, 1933, 632, 8338, 2] */
|
|
function _fun66379(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8522:6, offset: 0x01bf960c, size: 192 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const closure = useChangelog;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
|
|
const changelogStore = importDefault(4604) /* metro dependency 4604: ChangelogStore */;
|
|
const env0_6 = (require(1933) /* metro dependency 1933: ChangelogConstants */).ChangelogLoadState;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/changelog/useCurrentChangelog.tsx');
|
|
exports.useChangelog = closure;
|
|
exports.useCurrentChangelog = useCurrentChangelog;
|
|
}
|
|
|
|
function useChangelog(a0, a1) { // fn#66380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8522:155, offset: 0x01bf96cc, size: 275 bytes, params: 3, frame: 22
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const value2 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStoresObject([ChangelogStore],
|
|
_fun66381, [a0, a1]);
|
|
const changelog = value2.changelog;
|
|
const loadState = value2.loadState;
|
|
const env0_3 = loadState;
|
|
const defaultChangelog = value2.defaultChangelog;
|
|
const defaultLoadState = value2.defaultLoadState;
|
|
env0_3.useEffect(_fun66382, [a0, changelog, loadState, a1]);
|
|
return a0 == null ? {'id': null, 'changelog': null, 'loaded': false, id: a0} : changelog != null ? {id: a0,
|
|
changelog: changelog,
|
|
loaded: loadState !== ChangelogLoadState.NOT_LOADED} : loadState === ChangelogLoadState.LOADED_FAILURE ? {id: a0,
|
|
changelog: defaultChangelog, loaded: defaultLoadState !== ChangelogLoadState.NOT_LOADED} : {id: a0,
|
|
changelog: changelog, loaded: loadState !== ChangelogLoadState.NOT_LOADED};
|
|
}
|
|
|
|
function useCurrentChangelog() { // fn#66383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8522:927, offset: 0x01bf98fc, size: 377 bytes, params: 1, frame: 21
|
|
const locale = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([LocaleStore],
|
|
function() {
|
|
return LocaleStore.locale;
|
|
});
|
|
const value2 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([ChangelogStore],
|
|
function() {
|
|
return ChangelogStore.latestChangelogId();
|
|
});
|
|
const config = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([ChangelogStore],
|
|
function() {
|
|
return ChangelogStore.getConfig();
|
|
});
|
|
const r5 = config != null && global.Object.keys(config).length === 0;
|
|
const r2 = config != null && global.Object.keys(config).length > 0 && value2 == null;
|
|
const value8 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([ChangelogStore],
|
|
function() {
|
|
return ChangelogStore.overrideId();
|
|
});
|
|
let value = useChangelog(value2, locale);
|
|
const changelog = value.changelog;
|
|
const loaded = value.loaded;
|
|
value = useChangelog(value8, locale);
|
|
const changelog2 = value.changelog;
|
|
const loaded2 = value.loaded;
|
|
return value8 == null ? {id: value2, changelog: changelog, loaded: r5 ? !!r5 : loaded,
|
|
clientTooOld: r2} : changelog2 != null ? {id: value8, changelog: changelog2, loaded: loaded2,
|
|
clientTooOld: false} : loaded2 ? {id: value2, changelog: changelog, loaded: r5 ? !!r5 : loaded,
|
|
clientTooOld: r2} : {id: value8, changelog: changelog2, loaded: loaded2, clientTooOld: false};
|
|
}
|
|
|
|
function _fun66381() { // fn#66381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8522:226, offset: 0x01bf97df, size: 185 bytes, params: 1, frame: 18
|
|
const value2 = null;
|
|
return {changelog: value2 != env0_0 ? ChangelogStore.getChangelog(env0_0, require) : value2,
|
|
loadState: value2 != env0_0 && ChangelogStore.getChangelogLoadStatus(env0_0, require),
|
|
defaultChangelog: value2 != env0_0 ? ChangelogStore.getChangelog(env0_0, 'en-US') : value2,
|
|
defaultLoadState: value2 != env0_0 && ChangelogStore.getChangelogLoadStatus(env0_0, 'en-US')};
|
|
}
|
|
|
|
function _fun66382() { // fn#66382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8522:564, offset: 0x01bf9898, size: 100 bytes, params: 1, frame: 13
|
|
var value6;
|
|
var defaultImport;
|
|
if (env0_0 != null && changelog == null && loadState === ChangelogLoadState.NOT_LOADED) {
|
|
value6 = environment.__proto__;
|
|
defaultImport = importDefault(8338) /* metro dependency 8338: ChangeLogActionCreators */;
|
|
defaultImport.fetchChangelog(env0_0, require);
|
|
}
|
|
}
|
|
|