daon't error if context isnt defined
This commit is contained in:
parent
3f032619b4
commit
be495b1c56
@ -99,7 +99,7 @@ export default class EventBus {
|
||||
commandId: context.commandId,
|
||||
comms: context.comms ? {
|
||||
forwardTo: context.comms.forwardTo,
|
||||
sourceFrame: context.comms.sourceFrame ? { ...context.comms.sourceFrame } : undefined
|
||||
sourceFrame: context.comms?.sourceFrame ? { ...context.comms?.sourceFrame } : undefined
|
||||
} : undefined,
|
||||
borderCrossings: context.borderCrossings ? { ...context.borderCrossings } : undefined
|
||||
};
|
||||
|
||||
@ -266,11 +266,11 @@ class CommsServer {
|
||||
* @param frame
|
||||
*/
|
||||
private async sendToOtherFrames(message, context) {
|
||||
const sender = context.comms.sourceFrame;
|
||||
const sender = context.comms?.sourceFrame;
|
||||
|
||||
const enrichedMessage = {
|
||||
message,
|
||||
_sourceFrame: context.comms.sourceFrame,
|
||||
_sourceFrame: context.comms?.sourceFrame,
|
||||
_sourcePort: context.comms.port
|
||||
}
|
||||
|
||||
|
||||
@ -99,14 +99,14 @@ export default class IframeManager {
|
||||
} else {
|
||||
this.iframeList.push({
|
||||
...data,
|
||||
...context.comms.sourceFrame
|
||||
...context.comms?.sourceFrame
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private handleFrameDestroyed(context) {
|
||||
// tab IDs should be the same for all items, making frameId sufficiently unique to filter stuff
|
||||
this.iframeList = this.iframeList.filter(x => x.frameId !== context.comms.sourceFrame.frameId);
|
||||
this.iframeList = this.iframeList.filter(x => x.frameId !== context.comms?.sourceFrame?.frameId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user