decord/source/modules/rpc/helpers/getCurrentEmbeddedChannel.tsx
github-actions ecf26fc058 chore: update source for alpha 347.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
2026-09-16 07:03:15 +00:00

33 lines
1.2 KiB
TypeScript

// Module ID: 14588
// Function ID: 14589
// Name: getCurrentEmbeddedChannel
// Dependencies: [9653, 1958, 4542, 9654, 14584, 2]
// Exports: default
// Module 14588 (getCurrentEmbeddedChannel)
import getCurrentEmbeddedActivityChannelDefault from "getCurrentEmbeddedActivityChannel" /* 14584 */;
import FramesStore from "FramesStore" /* 9653 */;
import ChannelStore from "ChannelStore" /* 1958 */;
const TransportTypes = fn(4542).TransportTypes;
const EmbeddedSurfaceType = fn(9654).EmbeddedSurfaceType;
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.MAIN !== type) {
return ChannelStore.getChannel(surface.channelId);
}
} else {
return getCurrentEmbeddedActivityChannelDefault();
}
}
};