decord/alpha/source/modules/rpc/helpers/getCurrentEmbeddedChannel.tsx
github-actions c6aa9eb120 chore: update source for alpha 349.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5030.js (118.4 MB)
2026-10-01 06:55:13 +00:00

34 lines
1.2 KiB
TypeScript

// Module ID: 14242
// Function ID: 14243
// Name: getCurrentEmbeddedChannel
// Dependencies: [8690, 2044, 5270, 8692, 14238, 2]
// Exports: default
// Module 14242 (getCurrentEmbeddedChannel)
import EmbeddedSurfaceType from "EmbeddedSurfaceType" /* 8692 */;
import getCurrentEmbeddedActivityChannelDefault from "getCurrentEmbeddedActivityChannel" /* 14238 */;
import FramesStore from "FramesStore" /* 8690 */;
import ChannelStore from "ChannelStore" /* 2044 */;
require = fn;
const TransportTypes = fn(5270).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();
}
}
};