From 2546902bcf1f28cc423bb8a06be891141d4470f3 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Mon, 3 Apr 2017 16:59:31 -0600 Subject: [PATCH] Still grab the url when we have the id --- client/coral-embed/src/index.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/client/coral-embed/src/index.js b/client/coral-embed/src/index.js index 9b1b29879..21c176500 100644 --- a/client/coral-embed/src/index.js +++ b/client/coral-embed/src/index.js @@ -175,15 +175,13 @@ Talk.render = function (el, opts) { query.comment_id = window.location.hash.slice(1); query.asset_id = opts.asset_id; - if (!query.asset_id) { - query.asset_url = opts.asset_url; - if (!query.asset_url && !query.asset_id) { - try { - query.asset_url = document.querySelector('link[rel="canonical"]').href; - } catch (e) { - console.warn('This page does not include a canonical link tag. Talk has inferred this asset_url from the window object. Query params have been stripped, which may cause a single thread to be present across multiple pages.'); - query.asset_url = window.location.origin + window.location.pathname; - } + query.asset_url = opts.asset_url; + if (!query.asset_url) { + try { + query.asset_url = document.querySelector('link[rel="canonical"]').href; + } catch (e) { + console.warn('This page does not include a canonical link tag. Talk has inferred this asset_url from the window object. Query params have been stripped, which may cause a single thread to be present across multiple pages.'); + query.asset_url = window.location.origin + window.location.pathname; } }