decord/source/modules/media_channel/MediaPostEmbedStore.tsx
github-actions 4f02868c60 chore: update source for alpha 346.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
2026-09-11 10:30:06 +00:00

63 lines
2.1 KiB
TypeScript

// Module ID: 11522
// Function ID: 11523
// Name: MediaPostEmbedStore
// Dependencies: [504, 573, 2]
// Module 11522 (MediaPostEmbedStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
const FetchState = { NOT_FETCHED: 0, [0]: "NOT_FETCHED", FETCHING: 1, [1]: "FETCHING", FETCHED: 2, [2]: "FETCHED", FAILED: 3, [3]: "FAILED" };
let closure_1 = {};
let closure_2 = {};
const Store = initializeDefault.Store;
class MediaPostEmbedStore extends Store {
}
const prototype = MediaPostEmbedStore.prototype;
prototype["getMediaPostEmbed"] = function getMediaPostEmbed(mediaPostEmbedChannelId) {
if (null != mediaPostEmbedChannelId) {
return closure_1[mediaPostEmbedChannelId];
}
};
prototype["getEmbedFetchState"] = function getEmbedFetchState(mediaPostEmbedChannelId) {
let NOT_FETCHED = closure_2[mediaPostEmbedChannelId];
if (NOT_FETCHED == null) {
NOT_FETCHED = obj.NOT_FETCHED;
}
return NOT_FETCHED;
};
prototype["getMediaPostEmbeds"] = function getMediaPostEmbeds() {
return closure_1;
};
MediaPostEmbedStore.displayName = "MediaPostEmbedStore";
const mediaPostEmbedStore = new MediaPostEmbedStore(DispatcherDefault, {
CONNECTION_OPEN: function handleConnectionOpen() {
closure_1 = {};
closure_2 = {};
},
MEDIA_POST_EMBED_FETCH: function handleFetchMediaPostEmbed(threadId) {
closure_2[threadId.threadId] = obj.FETCHING;
},
MEDIA_POST_EMBED_FETCH_SUCCESS: function handleFetchMediaPostEmbedSuccess(threadId) {
threadId = threadId.threadId;
const obj = {};
const merged = Object.assign(closure_1);
obj[threadId] = threadId.mediaPostEmbed;
closure_1 = obj;
closure_2[threadId] = obj.FETCHED;
},
MEDIA_POST_EMBED_FETCH_FAILURE: function handleFetchMediaPostFailure(threadId) {
closure_2[threadId.threadId] = obj.FAILED;
},
LOGOUT: function handleLogout(isSwitchingAccount) {
if (!isSwitchingAccount.isSwitchingAccount) {
closure_1 = {};
closure_2 = {};
}
}
});
const size = fn(2);
const result = size.fileFinishedImporting("modules/media_channel/MediaPostEmbedStore.tsx");
export default mediaPostEmbedStore;
export { FetchState };