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);
connect(function (newContentJson) {
appPromise.then((app) => {
app.ports.fromJsPort.send({ contentJson: newContentJson });
if (typeof connect === "function") {
connect(function (newContentJson) {
appPromise.then((app) => {
app.ports.fromJsPort.send({ contentJson: newContentJson });
});
});
});
}