decord/alpha/source/modules/rpc/helpers/getCurrentEmbeddedChannel.tsx
github-actions e160b228c5 chore: update source for alpha 348.1
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4942.js (118.4 MB)
2026-09-22 07:41:18 +00:00

34 lines
1.2 KiB
TypeScript

// Module ID: 14758
// Function ID: 14759
// Name: getCurrentEmbeddedChannel
// Dependencies: [9318, 2042, 4661, 9320, 14754, 2]
// Exports: default
// Module 14758 (getCurrentEmbeddedChannel)
import EmbeddedSurfaceType from "EmbeddedSurfaceType" /* 9320 */;
import getCurrentEmbeddedActivityChannelDefault from "getCurrentEmbeddedActivityChannel" /* 14754 */;
import FramesStore from "FramesStore" /* 9318 */;
import ChannelStore from "ChannelStore" /* 2042 */;
require = fn;
const TransportTypes = fn(4661).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();
}
}
};