From 34993f50566d18c24ff0a72974161128c80a75bf Mon Sep 17 00:00:00 2001 From: cballevre Date: Tue, 26 Sep 2023 11:19:37 +0200 Subject: [PATCH] feat: Replace the page title with the home.override-title flag This new flag is useful with the arrival of white-label applications --- src/targets/browser/index.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/targets/browser/index.jsx b/src/targets/browser/index.jsx index 8b80c3c86a..2f04c98834 100644 --- a/src/targets/browser/index.jsx +++ b/src/targets/browser/index.jsx @@ -1,5 +1,7 @@ import { createRoot } from 'react-dom/client' +import flag from 'cozy-flags' + import { renderApp } from './renderApp' const onReady = () => { @@ -11,6 +13,10 @@ const onReady = () => { } export const _main = () => { + if (flag('home.override-title')) { + document.title = flag('home.override-title') + } + if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', onReady) } else {