From f372bd43769b02f1eb0453434bb7f81afb2d65d2 Mon Sep 17 00:00:00 2001 From: A Jordan Simonds Date: Mon, 4 Dec 2017 16:07:26 -0500 Subject: [PATCH 1/2] fix: Powered-by component is not SSR compatible #367 Add a null check to the `location` reference in `algoliaUrl`. fixes #367 --- src/components/PoweredBy.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/PoweredBy.vue b/src/components/PoweredBy.vue index 8331d68ea..a4bf26d99 100644 --- a/src/components/PoweredBy.vue +++ b/src/components/PoweredBy.vue @@ -43,7 +43,7 @@ export default { 'https://www.algolia.com/?' + 'utm_source=vue-instantsearch&' + 'utm_medium=website&' + - `utm_content=${location.hostname}&` + + ( location ? `utm_content=${location.hostname}&` : '' ) + 'utm_campaign=poweredby' ); }, From 7344f5fbaf7a7b08b9a81ae1972f949f4579e780 Mon Sep 17 00:00:00 2001 From: A Jordan Simonds Date: Mon, 4 Dec 2017 16:16:14 -0500 Subject: [PATCH 2/2] fix test fialures --- src/components/PoweredBy.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/PoweredBy.vue b/src/components/PoweredBy.vue index a4bf26d99..7d0dfcb75 100644 --- a/src/components/PoweredBy.vue +++ b/src/components/PoweredBy.vue @@ -43,7 +43,7 @@ export default { 'https://www.algolia.com/?' + 'utm_source=vue-instantsearch&' + 'utm_medium=website&' + - ( location ? `utm_content=${location.hostname}&` : '' ) + + `utm_content=${location ? location.hostname : ''}&` + 'utm_campaign=poweredby' ); },