Skip to content

Commit

Permalink
feat: Replace the page title with the home.override-title flag
Browse files Browse the repository at this point in the history
This new flag is useful with the arrival of white-label applications
  • Loading branch information
cballevre committed Sep 26, 2023
1 parent ff23692 commit 34993f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/targets/browser/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { createRoot } from 'react-dom/client'

import flag from 'cozy-flags'

import { renderApp } from './renderApp'

const onReady = () => {
Expand All @@ -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 {
Expand Down

0 comments on commit 34993f5

Please sign in to comment.