From da07b737b2d27750e02bbcc7d9a47b1c44cbb16b Mon Sep 17 00:00:00 2001 From: David Jay Date: Fri, 18 Nov 2016 12:19:58 -0500 Subject: [PATCH] Allowing commentstream to be rendered outside of embed. --- client/coral-embed-stream/src/CommentStream.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/coral-embed-stream/src/CommentStream.js b/client/coral-embed-stream/src/CommentStream.js index 6fc48a826..f5ac55db8 100644 --- a/client/coral-embed-stream/src/CommentStream.js +++ b/client/coral-embed-stream/src/CommentStream.js @@ -61,8 +61,8 @@ class CommentStream extends Component { // Set up messaging between embedded Iframe an parent component // Using recommended Pym init code which violates .eslint standards const pym = new Pym.Child({polling: 100}); - const path = /https?\:\/\/([^?]+)/.exec(pym.parentUrl)[1]; - this.props.getStream(path); + const path = /https?\:\/\/([^?]+)/.exec(pym.parentUrl); + this.props.getStream(path && path[1] || window.location); } render () {