From 22e79503a015ca7e9d6e49c815c8d9e9eef7b54b Mon Sep 17 00:00:00 2001 From: Julio Marquez Date: Tue, 11 Dec 2018 14:37:50 -0400 Subject: [PATCH] fix(core): display the Subscribe button if the notifications are enabled --- .../core/client/components/Header.vue | 13 +++++++- .../core/client/components/mixins/head.js | 32 +++++++++---------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/packages/@statusfy/core/client/components/Header.vue b/packages/@statusfy/core/client/components/Header.vue index bfb6cfe73..4c07b5ac9 100644 --- a/packages/@statusfy/core/client/components/Header.vue +++ b/packages/@statusfy/core/client/components/Header.vue @@ -15,7 +15,9 @@ - @@ -32,6 +34,15 @@ export default { type: String, default: 'div' } + }, + computed: { + displaySubscribe () { + if (this.$statusfy.notifications && (typeof this.$statusfy.notifications === 'object')) { + return !!Object.values(this.$statusfy.notifications).find(v => v) + } else { + return false + } + } } } diff --git a/packages/@statusfy/core/client/components/mixins/head.js b/packages/@statusfy/core/client/components/mixins/head.js index 01c504da0..fa8b0e69e 100644 --- a/packages/@statusfy/core/client/components/mixins/head.js +++ b/packages/@statusfy/core/client/components/mixins/head.js @@ -1,5 +1,5 @@ export default { - head() { + head () { const favicons = this.$statusfy.iconSizes.map(size => { return { hid: `favicon-${size}`, @@ -19,19 +19,19 @@ export default { : `${this.$statusfy.baseUrl}/feeds` linksFeeds = [{ - rel: 'alternate', - type: 'application/rss+xml', - hid: 'alternate-feed-rss', - title: '', - href: `${feedsBaseUrl}/incidents.${this.$i18n.locale}.xml` - }, - { - rel: 'alternate', - type: 'application/atom+xml', - hid: 'alternate-feed-atom', - title: '', - href: `${feedsBaseUrl}/incidents.${this.$i18n.locale}.atom`, - }, + rel: 'alternate', + type: 'application/rss+xml', + hid: 'alternate-feed-rss', + title: '', + href: `${feedsBaseUrl}/incidents.${this.$i18n.locale}.xml` + }, + { + rel: 'alternate', + type: 'application/atom+xml', + hid: 'alternate-feed-atom', + title: '', + href: `${feedsBaseUrl}/incidents.${this.$i18n.locale}.atom` + } ] } @@ -43,8 +43,8 @@ export default { rel: 'canonical', href: canonical, hid: 'canonical' - }, - ], + } + ] } }