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