- Settings > General: an App name (super admin) for the installed app. The manifest's name/short_name, the iOS head tags and the loading page's title use it, so two installs on one phone can be told apart. - Notifications get a real badge (white stone silhouette): Android masks the badge by alpha, so the opaque app icon showed as a square. - The loading and offline pages load the app's font. - The font is now Archivo (variable, one request for every weight), matching the marketing site. Co-Authored-By: Claude Opus 5.5 <[email protected]>
28 lines
818 B
TypeScript
28 lines
818 B
TypeScript
import { SiteData } from "@/src/data/site-data";
|
|
|
|
type Params = {
|
|
manifest: Record<string, unknown>;
|
|
install_name?: string | null;
|
|
};
|
|
|
|
/**
|
|
* The generated manifest with the install's own name, so the launcher
|
|
* tells two installs apart. `short_name` (the label under the icon) is the
|
|
* name alone; `name` adds `SiteName` unless the name already says it.
|
|
* Unnamed, the manifest is unchanged.
|
|
*/
|
|
export default function namePwaManifest({ manifest, install_name }: Params) {
|
|
const name = install_name?.trim();
|
|
|
|
if (!name) return manifest;
|
|
|
|
const site_name = SiteData["SiteName"];
|
|
const says_site_name = name.toLowerCase().includes(site_name.toLowerCase());
|
|
|
|
return {
|
|
...manifest,
|
|
name: says_site_name ? name : `${name} - ${site_name}`,
|
|
short_name: name,
|
|
};
|
|
}
|