From c7392c89b56b2c9c3378a72257075870cbb3a69d Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sat, 24 Sep 2022 01:40:24 +0200 Subject: [PATCH] Fix missing webmanifest in PWA for Android (#2051) --- src/index.html | 2 +- src/util/updateWebmanifest.ts | 6 +++++- webpack.config.js | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/index.html b/src/index.html index d8c5518fc..e51ae83c0 100644 --- a/src/index.html +++ b/src/index.html @@ -39,7 +39,7 @@ - + diff --git a/src/util/updateWebmanifest.ts b/src/util/updateWebmanifest.ts index 81458bdd8..ab1a69e9b 100644 --- a/src/util/updateWebmanifest.ts +++ b/src/util/updateWebmanifest.ts @@ -5,11 +5,15 @@ import { DEBUG } from '../config'; import { IS_MAC_OS } from './environment'; export default function updateWebmanifest() { + if (!IS_MAC_OS) { + return; + } + const manifest = document.getElementById('the-manifest-placeholder'); if (!manifest) { return; } - const url = `site${IS_MAC_OS ? '_apple' : ''}${DEBUG ? '_dev' : ''}.webmanifest`; + const url = `site_apple${DEBUG ? '_dev' : ''}.webmanifest`; manifest.setAttribute('href', url); } diff --git a/webpack.config.js b/webpack.config.js index b5ca07c88..c0eb41bcf 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -144,6 +144,7 @@ module.exports = (_env, { mode = 'production' }) => { appName: APP_ENV === 'production' ? 'Telegram Web' : 'Telegram Web Beta', appleIcon: APP_ENV === 'production' ? 'apple-touch-icon' : 'apple-touch-icon-dev', mainIcon: APP_ENV === 'production' ? 'icon-192x192' : 'icon-dev-192x192', + manifest: APP_ENV === 'production' ? 'site.webmanifest' : 'site_dev.webmanifest', template: 'src/index.html', }), new MiniCssExtractPlugin({