From 43bbdea421853fa251d6d73da244d26eef07ecdc Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Mon, 17 Jun 2024 11:00:26 +0200 Subject: [PATCH] Fix invalid `mask-icon` when a custom instance icon is configured (#30734) --- app/helpers/application_helper.rb | 4 ++++ app/views/layouts/application.html.haml | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7563ae6105..7e9cfee3f6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -256,6 +256,10 @@ module ApplicationHelper instance_presenter.app_icon&.file&.url(size) end + def use_mask_icon? + instance_presenter.app_icon.blank? + end + private def storage_host_var diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index a73287959e..e7f1a595e5 100755 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -19,7 +19,8 @@ - SiteUpload::APPLE_ICON_SIZES.each do |size| %link{ rel: 'apple-touch-icon', sizes: "#{size}x#{size}", href: app_icon_path(size.to_i) || frontend_asset_path("icons/apple-touch-icon-#{size}x#{size}.png") }/ - %link{ rel: 'mask-icon', href: frontend_asset_path('images/logo-symbol-icon.svg'), color: '#6364FF' }/ + - if use_mask_icon? + %link{ rel: 'mask-icon', href: frontend_asset_path('images/logo-symbol-icon.svg'), color: '#6364FF' }/ %link{ rel: 'manifest', href: manifest_path(format: :json) }/ = theme_color_tags current_theme %meta{ name: 'apple-mobile-web-app-capable', content: 'yes' }/