Fix ready message sent to parent frame

This commit is contained in:
artrejo
2021-03-18 20:41:43 -07:00
parent 3cccbdfe81
commit f929a638d6
6 changed files with 35 additions and 20 deletions

View File

@@ -83,10 +83,10 @@ export default class MongoShellTab extends TabsBase {
}
private handleReadyMessage(event: MessageEvent, shellIframe: HTMLIFrameElement) {
if (typeof event.data["data"] !== "string") {
if (typeof event.data["kind"] !== "string") {
return;
}
if (event.data.data !== "ready") {
if (event.data.kind !== "ready") {
return;
}
@@ -100,7 +100,7 @@ export default class MongoShellTab extends TabsBase {
documentEndpoint.substr(
Constants.MongoDBAccounts.protocol.length + 3,
documentEndpoint.length -
(Constants.MongoDBAccounts.protocol.length + 2 + Constants.MongoDBAccounts.defaultPort.length)
(Constants.MongoDBAccounts.protocol.length + 2 + Constants.MongoDBAccounts.defaultPort.length)
) + Constants.MongoDBAccounts.defaultPort.toString();
const databaseId = this.collection.databaseId;
const collectionId = this.collection.id();