diff --git a/app/controllers/metadata_controller.rb b/app/controllers/metadata_controller.rb index 51d1a1e1f88..279cb99345a 100644 --- a/app/controllers/metadata_controller.rb +++ b/app/controllers/metadata_controller.rb @@ -47,12 +47,16 @@ class MetadataController < ApplicationController } logo = SiteSetting.site_manifest_icon_url - manifest[:icons] << { - src: UrlHelper.absolute(logo), - purpose: "maskable", - sizes: "512x512", - type: MiniMime.lookup_by_filename(logo)&.content_type || "image/png" - } if logo + if logo + icon_entry = { + src: UrlHelper.absolute(logo), + sizes: "512x512", + type: MiniMime.lookup_by_filename(logo)&.content_type || "image/png" + } + manifest[:icons] << icon_entry.dup + icon_entry[:purpose] = "maskable" + manifest[:icons] << icon_entry + end manifest[:short_name] = SiteSetting.short_title if SiteSetting.short_title.present?