Fix invalid mask-icon when a custom instance icon is configured (#30734)

This commit is contained in:
Renaud Chaput 2024-06-17 11:00:26 +02:00 committed by GitHub
parent 5addffb604
commit 43bbdea421
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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' }/