From df0d7262b4476882039804ba70f07f6fca084b3e Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Mon, 8 Feb 2021 16:39:15 +0530 Subject: [PATCH] fix: Show push notifications settings except Safari (#1741) --- app/javascript/dashboard/components/Code.vue | 4 ++-- .../settings/profile/NotificationSettings.vue | 16 ++++++++++------ app/views/layouts/vueapp.html.erb | 4 ++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/javascript/dashboard/components/Code.vue b/app/javascript/dashboard/components/Code.vue index 0be14acf3..b5edfa8d7 100644 --- a/app/javascript/dashboard/components/Code.vue +++ b/app/javascript/dashboard/components/Code.vue @@ -3,7 +3,7 @@ - + @@ -15,7 +15,7 @@ export default { props: { script: { type: String, - required: true, + default: '', }, lang: { type: String, diff --git a/app/javascript/dashboard/routes/dashboard/settings/profile/NotificationSettings.vue b/app/javascript/dashboard/routes/dashboard/settings/profile/NotificationSettings.vue index 2d5e7b725..a2d6bf215 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/profile/NotificationSettings.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/profile/NotificationSettings.vue @@ -79,7 +79,10 @@ -
+

{{ $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; -} diff --git a/app/views/layouts/vueapp.html.erb b/app/views/layouts/vueapp.html.erb index 5f5c43b81..6ec5e5c01 100644 --- a/app/views/layouts/vueapp.html.erb +++ b/app/views/layouts/vueapp.html.erb @@ -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', '')%>' <%= javascript_pack_tag 'application' %>