mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-27 01:12:50 +03:00
Make sure connect is defined before running it.
This commit is contained in:
parent
ebc7812973
commit
e94d9b0cf7
@ -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 });
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user