mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-30 03:11:30 +03:00
Check if port is defined before subscribing to avoid error if port is unused.
This commit is contained in:
parent
91c87dd235
commit
cfbbf71bf5
@ -27,7 +27,7 @@ function loadContentAndInitializeApp() {
|
||||
loadNamedAnchor();
|
||||
});
|
||||
|
||||
app.ports.elmPagesReloadData.subscribe(() => {
|
||||
app.ports.elmPagesReloadData && app.ports.elmPagesReloadData.subscribe(() => {
|
||||
console.log("RELOAD DATA PORT!");
|
||||
app.ports.fromJsPort.send(null);
|
||||
});
|
||||
|
@ -28,6 +28,7 @@ function loadContentAndInitializeApp() {
|
||||
loadNamedAnchor();
|
||||
});
|
||||
|
||||
app.ports.elmPagesReloadData &&
|
||||
app.ports.elmPagesReloadData.subscribe(() => {
|
||||
console.log("RELOAD DATA PORT!");
|
||||
app.ports.fromJsPort.send(null);
|
||||
|
Loading…
Reference in New Issue
Block a user