decord/source/modules/cache/CacheActionCreators.tsx

140 lines
4.1 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 14942
// Function ID: 14943
2026-07-20 16:05:17 +00:00
// Name: _writeCaches
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 1391, 5072, 709, 2]
2026-07-20 16:05:17 +00:00
// Exports: clearCaches, writeCaches
2026-08-24 06:08:38 +00:00
// Module 14942 (_writeCaches)
import dispatcherDefault from "dispatcher" /* 709 */;
import closure_2 from "asyncGeneratorStep" /* 5 */;
import { ChannelLoader } from "ensureGuildLoaded" /* 1391 */;
import closure_4 from "handleClearCaches" /* 5072 */;
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
function _writeCaches() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback(() => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*() {
2026-08-04 21:03:28 +00:00
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
2026-08-04 21:03:28 +00:00
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-08-04 21:03:28 +00:00
}
} else {
try {
c4 = 2;
if (0 === c3) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_2 = tmp5;
2026-08-04 21:03:28 +00:00
let table = tmp2;
let flag;
if (flag === undefined) {
flag = false;
}
table = undefined;
c3 = 1;
c4 = 1;
2026-08-12 06:57:52 +00:00
return { value: "ct", done: true };
2026-08-04 21:03:28 +00:00
}
} else {
if (1 === tmp5) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-08-04 21:03:28 +00:00
obj1[0] = arg1;
return obj1;
} else if (c4.canWriteCaches(flag)) {
c3 = 2;
c4 = 1;
const obj2 = { value: null, done: false };
obj2[0] = c3.loadAllMissingChannels();
return obj2;
}
} else if (2 === tmp5) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
const obj3 = { value: null, done: true };
obj3[0] = arg1;
return obj3;
} else {
table = [];
obj1 = flag(table[3]);
const obj4 = { type: "WRITE_CACHES", promisesToWaitOn: null };
obj4[1] = table;
obj1.dispatch(obj4);
c3 = 3;
c4 = 1;
const obj5 = { value: null, done: false };
obj5[0] = Promise.all(table);
return obj5;
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
c4 = 3;
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-08-04 21:03:28 +00:00
}
} catch (tmp20) {
c4 = tmp;
throw tmp20;
2026-07-29 08:29:29 +00:00
}
}
})();
iter.next();
return iter;
});
2026-08-24 06:08:38 +00:00
closure_5 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/cache/CacheActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export const writeCaches = function writeCaches(arg0) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _writeCaches.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
export const clearCaches = function clearCaches() {
2026-08-24 06:08:38 +00:00
dispatcherDefault.dispatch({ type: "CLEAR_CACHES", reason: "Requested by user", preventWritingCachesAgainThisSession: true, resetSocket: true });
2026-07-20 16:05:17 +00:00
};