POS: Fix manifest (#4373)

- Manifest v1 doesn't support HEX colors
- Make icon URLs absolute

Closes #4363.
This commit is contained in:
d11n 2022-11-28 12:35:52 +01:00 committed by GitHub
parent 425d70f261
commit 84132e794a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -25,7 +25,12 @@
var jObject = JObject.Parse(await reader.ReadToEndAsync());
jObject["short_name"] = title;
jObject["name"] = $"BTCPay Server: {title}";
return $"data:application/manifest+json, {jObject.ToString(Formatting.None)}";
foreach (var jToken in jObject["icons"]!)
{
var icon = (JObject)jToken;
icon["src"] = $"{Context.Request.GetAbsoluteRoot()}/{icon["src"]}";
}
return $"data:application/manifest+json,{Safe.Json(jObject)}";
}
}
@ -45,7 +50,6 @@
<link href="~/main/fonts/OpenSans.css" asp-append-version="true" rel="stylesheet" />
<link href="~/main/layout.css" asp-append-version="true" rel="stylesheet" />
<link href="~/main/site.css" asp-append-version="true" rel="stylesheet" />
<link href="@Context.Request.GetRelativePathOrAbsolute(Theme.CssUri)" rel="stylesheet" asp-append-version="true"/>
@if (Model.CustomCSSLink != null)
{

View File

@ -1,8 +1,8 @@
{
"name": "BTCPayServer Point of Sale",
"name": "BTCPay Server Point of Sale",
"short_name": "BTCPay POS",
"theme_color": "#1e7a44",
"background_color": "#ffffff",
"theme_color": "green",
"background_color": "white",
"display": "standalone",
"icons": [
{
@ -47,4 +47,4 @@
}
],
"splash_pages": null
}
}