fix: Show push notifications settings except Safari (#1741)

This commit is contained in:
Pranav Raj S 2021-02-08 16:39:15 +05:30 committed by GitHub
parent d4c2a78db6
commit df0d7262b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 8 deletions

View file

@ -3,7 +3,7 @@
<button class="button small button--copy-code" @click="onCopy">
{{ $t('COMPONENTS.CODE.BUTTON_TEXT') }}
</button>
<highlightjs :language="lang" :code="script" />
<highlightjs v-if="script" :language="lang" :code="script" />
</div>
</template>
@ -15,7 +15,7 @@ export default {
props: {
script: {
type: String,
required: true,
default: '',
},
lang: {
type: String,

View file

@ -79,7 +79,10 @@
</div>
</div>
</div>
<div v-if="vapidPublicKey" class="profile--settings--row row push-row">
<div
v-if="vapidPublicKey && !isBrowserSafari"
class="profile--settings--row row push-row"
>
<div class="columns small-3 ">
<h4 class="block-title">
{{ $t('PROFILE_SETTINGS.FORM.PUSH_NOTIFICATIONS_SECTION.TITLE') }}
@ -202,6 +205,12 @@ export default {
emailFlags: 'userNotificationSettings/getSelectedEmailFlags',
pushFlags: 'userNotificationSettings/getSelectedPushFlags',
}),
isBrowserSafari() {
if (window.browserConfig) {
return window.browserConfig.is_safari === 'true';
}
return false;
},
},
watch: {
emailFlags(value) {
@ -285,9 +294,4 @@ export default {
.notification--checkbox {
font-size: $font-size-large;
}
// Hide on Safari
.push-row:not(:root:root) {
display: none;
}
</style>

View file

@ -42,6 +42,10 @@
selectedLocale: '<%= I18n.locale %>'
}
window.globalConfig = <%= raw @global_config.to_json %>
window.browserConfig = {
browser_name: '<%= browser.name %>',
is_safari: '<%= browser.safari? %>'
}
window.errorLoggingConfig = '<%= ENV.fetch('SENTRY_DSN', '')%>'
</script>
<%= javascript_pack_tag 'application' %>