Make sure connect is defined before running it.

This commit is contained in:
Dillon Kearns 2021-04-17 21:21:17 -07:00
parent ebc7812973
commit e94d9b0cf7

View File

@ -175,8 +175,10 @@ const appPromise = pagesInit({
}); });
userInit(appPromise); userInit(appPromise);
connect(function (newContentJson) { if (typeof connect === "function") {
appPromise.then((app) => { connect(function (newContentJson) {
app.ports.fromJsPort.send({ contentJson: newContentJson }); appPromise.then((app) => {
app.ports.fromJsPort.send({ contentJson: newContentJson });
});
}); });
}); }