mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-03-22 06:48:11 +00:00
fix tab title handling
This commit is contained in:
17
index.html
17
index.html
@@ -19,6 +19,23 @@
|
||||
<main id="reactRoot"></main>
|
||||
|
||||
<script type="module">
|
||||
const url = window.__INITIAL_PROPS__.config.baseUrl;
|
||||
console.log(window.__INITIAL_PROPS__);
|
||||
const title = window.__INITIAL_PROPS__.brew.title;
|
||||
|
||||
if(title && title.length !== 0) {
|
||||
document.title = `${title} - The Homebrewery`
|
||||
}
|
||||
|
||||
if (url.includes('://homebrewery-pr-')) {
|
||||
const match = url.match(/pr-(\d+)/);
|
||||
if (match) {
|
||||
document.title = `PR-${match[1]} ` + document.title;
|
||||
}
|
||||
} else if (url.includes('://localhost:')) {
|
||||
document.title = `LOCAL - ` + document.title;
|
||||
|
||||
}
|
||||
if (window.location.pathname.startsWith('/admin')) {
|
||||
import('/client/admin/main.jsx');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user