From 5df1c463a33a4b7e8f522ab6c847b9ba016b2351 Mon Sep 17 00:00:00 2001
From: Paul <paulmakles@gmail.com>
Date: Tue, 22 Jun 2021 19:59:02 +0100
Subject: [PATCH] Use different manifest for nightly.

---
 vite.config.ts | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/vite.config.ts b/vite.config.ts
index d3b5762..40a1a0a 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -37,6 +37,10 @@ function getVersion() {
   return readFileSync('VERSION').toString();
 }
 
+const branch = getGitBranch();
+const isNightly = branch !== 'production';
+const iconPrefix = isNightly ? 'nightly-' : '';
+
 export default defineConfig({
   plugins: [
     preact(),
@@ -45,9 +49,9 @@ export default defineConfig({
       filename: 'sw.ts',
       strategies: 'injectManifest',
       manifest: {
-        name: "REVOLT",
+        name: isNightly ? "REVOLT nightly" : "REVOLT",
         short_name: "REVOLT",
-        description: "User-first, privacy-focused chat platform.",
+        description: isNightly ? "Early preview builds of REVOLT." : "User-first, privacy-focused chat platform.",
         categories: ["messaging"],
         start_url: "/",
         display: "standalone",
@@ -55,12 +59,12 @@ export default defineConfig({
         background_color: "#101823",
         icons: [
             {
-                "src": "/assets/icons/android-chrome-192x192.png",
+                "src": `/assets/icons/${iconPrefix}android-chrome-192x192.png`,
                 "type": "image/png",
                 "sizes": "192x192"
             },
             {
-                "src": "/assets/icons/android-chrome-512x512.png",
+                "src": `/assets/icons/${iconPrefix}android-chrome-512x512.png`,
                 "type": "image/png",
                 "sizes": "512x512"
             }
-- 
GitLab