decord/alpha/source/modules/rpc/helpers/getCurrentEmbeddedChannel.tsx
github-actions 52331fb8ae chore: update source for alpha 349.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5051.js (118.4 MB)
2026-09-30 07:29:52 +00:00

34 lines
1.2 KiB
TypeScript

// Module ID: 14234
// Function ID: 14235
// Name: getCurrentEmbeddedChannel
// Dependencies: [8698, 2045, 4769, 8700, 14230, 2]
// Exports: default
// Module 14234 (getCurrentEmbeddedChannel)
import EmbeddedSurfaceType from "EmbeddedSurfaceType" /* 8700 */;
import getCurrentEmbeddedActivityChannelDefault from "getCurrentEmbeddedActivityChannel" /* 14230 */;
import FramesStore from "FramesStore" /* 8698 */;
import ChannelStore from "ChannelStore" /* 2045 */;
require = fn;
const TransportTypes = fn(4769).TransportTypes;
const size = fn(2);
const result = size.fileFinishedImporting("modules/rpc/helpers/getCurrentEmbeddedChannel.tsx");
export default function getCurrentEmbeddedChannel(source) {
if (source.source.type === TransportTypes.POST_MESSAGE) {
const frameByIframeId = FramesStore.getFrameByIframeId(source.source.iframeId);
let surface;
if (frameByIframeId != null) {
surface = frameByIframeId.surface;
}
if (null != surface) {
const type = surface.type;
if (EmbeddedSurfaceType.EmbeddedSurfaceType.MAIN !== type) {
return ChannelStore.getChannel(surface.channelId);
}
} else {
return getCurrentEmbeddedActivityChannelDefault();
}
}
};