Skip to content

πŸ“ˆ Open source, privacy-first web analytics β€” a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fixed linting errors & warnings

Blue Mouse8a6caabfa511
diff --git a/app/pages/Captcha/Settings/CaptchaSettings.tsx b/app/pages/Captcha/Settings/CaptchaSettings.tsx
index 3fd43dfaf..bf5f0ddd0 100644
--- a/app/pages/Captcha/Settings/CaptchaSettings.tsx
+++ b/app/pages/Captcha/Settings/CaptchaSettings.tsx
@@ -297,7 +297,7 @@ const CaptchaSettings = ({
pageTitle += ` ${TITLE_SUFFIX}`
document.title = pageTitle
- }, [form, t])
+ }, [form, t, isSettings])
const onRegenerateSecretKey = async () => {
try {
diff --git a/app/pages/Captcha/View/ViewCaptcha.tsx b/app/pages/Captcha/View/ViewCaptcha.tsx
index f2326effc..faab1b343 100644
--- a/app/pages/Captcha/View/ViewCaptcha.tsx
+++ b/app/pages/Captcha/View/ViewCaptcha.tsx
@@ -134,8 +134,16 @@ const ViewProject = ({
const { name } = project as IProject
useEffect(() => {
- document.title = `${name} ${TITLE_SUFFIX}`
- }, [project])
+ let pageTitle = name
+
+ if (!name) {
+ pageTitle = t('titles.main')
+ }
+
+ pageTitle += ` ${TITLE_SUFFIX}`
+
+ document.title = pageTitle
+ }, [name, t])
// @ts-ignore
const sharedRoles = useMemo(() => _find(user.sharedProjects, p => p.project.id === id)?.role || {}, [user, id])
diff --git a/app/pages/Project/Settings/ProjectSettings.tsx b/app/pages/Project/Settings/ProjectSettings.tsx
index deb683240..2ef1af3ba 100644
--- a/app/pages/Project/Settings/ProjectSettings.tsx
+++ b/app/pages/Project/Settings/ProjectSettings.tsx
@@ -384,7 +384,7 @@ const ProjectSettings = ({
pageTitle += ` ${TITLE_SUFFIX}`
document.title = pageTitle
- }, [form, t])
+ }, [form, t, isSettings])
return (
<div
diff --git a/app/pages/Project/View/ViewProject.tsx b/app/pages/Project/View/ViewProject.tsx
index 2bc70523a..5e60aa351 100644
--- a/app/pages/Project/View/ViewProject.tsx
+++ b/app/pages/Project/View/ViewProject.tsx
@@ -392,10 +392,15 @@ const ViewProject = ({
useEffect(() => {
let pageTitle = user?.showLiveVisitorsInTitle ? `πŸ‘€ ${liveStats[id]} - ${name}` : name
+
+ if (!pageTitle) {
+ pageTitle = t('titles.main')
+ }
+
pageTitle += ` ${TITLE_SUFFIX}`
document.title = pageTitle
- }, [project, user])
+ }, [name, user, liveStats, id, t])
// sharedRoles is a role for shared project
const sharedRoles = useMemo(() => _find(user.sharedProjects, p => p.project.id === id)?.role || {}, [user, id])
diff --git a/app/redux/sagas/auth/workers/logout.ts b/app/redux/sagas/auth/workers/logout.ts
index 997af3468..6ef94af2b 100644
--- a/app/redux/sagas/auth/workers/logout.ts
+++ b/app/redux/sagas/auth/workers/logout.ts
@@ -2,8 +2,8 @@ import { call, put } from 'redux-saga/effects'
import Debug from 'debug'
import UIActions from 'redux/reducers/ui'
-import { IStats } from '../../../models/IStats'
import { getRefreshToken, removeRefreshToken } from 'utils/refreshToken'
+import { IStats } from '../../../models/IStats'
const { getGeneralStats, logoutApi } = require('api')
const debug = Debug('swetrix:rx:s:logout')
diff --git a/app/root.tsx b/app/root.tsx
index acb42d898..9185d2aae 100644
--- a/app/root.tsx
+++ b/app/root.tsx
@@ -41,10 +41,6 @@ declare global {
}
}
-if (isBrowser) {
- console.log('%cWelcome, hacker, glad you opened your console, you seem serious about your craft and will go a long way!\nP.S. All the bugs, feature requests are welcome to be sent to [email protected]', 'color: #818cf8background: #1f2937font-size: 20pxtext-shadow: 2px 2px black')
-}
-
const options = {
position: positions.BOTTOM_RIGHT,
timeout: 8000,
@@ -134,6 +130,7 @@ export default function App() {
))}
<link rel='preload' href={`/locales/${locale}.json`} as='fetch' type='application/json' crossOrigin='anonymous' />
<script
+ // eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: `window.REMIX_ENV = ${JSON.stringify(
REMIX_ENV,
diff --git a/app/ui/icons/BackgroundSvg.tsx b/app/ui/icons/BackgroundSvg.tsx
index b6402c5a7..c12d8fb83 100644
--- a/app/ui/icons/BackgroundSvg.tsx
+++ b/app/ui/icons/BackgroundSvg.tsx
@@ -9,7 +9,9 @@ interface IBackgroundSvg {
theme: 'dark' | 'light'
}
-const BackgroundSvg: React.FC<IBackgroundSvg> = ({ className, type, children, theme }): JSX.Element => {
+const BackgroundSvg: React.FC<IBackgroundSvg> = ({
+ className, type, children, theme,
+}): JSX.Element => {
if (type === 'shapes') {
return (
<svg className={className} width='112' height='112' viewBox='0 0 112 112' fill='none' xmlns='http://www.w3.org/2000/svg'>
@@ -112,7 +114,7 @@ BackgroundSvg.propTypes = {
BackgroundSvg.defaultProps = {
className: '',
- type: 'shapes',
+ children: undefined,
}
export default BackgroundSvg
diff --git a/package.json b/package.json
index 36e0e0d53..aca8a3ecd 100644
--- a/package.json
+++ b/package.json
@@ -101,6 +101,7 @@
"jsx-a11y/control-has-associated-label": "off",
"jsx-a11y/label-has-for": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
+ "testing-library/prefer-user-event": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-quotes": [
"error",