Fix ESLint errors in dev title prefix
This commit is contained in:
@@ -41,11 +41,10 @@ history.listen(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const isDevEnvironment = () => {
|
const isDevEnvironment = () =>
|
||||||
return window.location.hostname.startsWith('dev.') ||
|
window.location.hostname.startsWith('dev.') ||
|
||||||
window.location.hostname === 'localhost' ||
|
window.location.hostname === 'localhost' ||
|
||||||
window.location.port === '3001';
|
window.location.port === '3001';
|
||||||
};
|
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -60,11 +59,13 @@ export default function App() {
|
|||||||
|
|
||||||
// Prefix title with [DEV] on dev environment
|
// Prefix title with [DEV] on dev environment
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isDevEnvironment()) return;
|
if (!isDevEnvironment()) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
const prefixTitle = () => {
|
const prefixTitle = () => {
|
||||||
if (!document.title.startsWith('[DEV] ')) {
|
if (!document.title.startsWith('[DEV] ')) {
|
||||||
document.title = '[DEV] ' + document.title;
|
document.title = `[DEV] ${document.title}`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user