forked from Archives/Athou_commafeed
remove unused google analytics support
This commit is contained in:
7
commafeed-client/package-lock.json
generated
7
commafeed-client/package-lock.json
generated
@@ -32,7 +32,6 @@
|
|||||||
"react-device-detect": "^2.2.3",
|
"react-device-detect": "^2.2.3",
|
||||||
"react-dom": "^19.1.1",
|
"react-dom": "^19.1.1",
|
||||||
"react-draggable": "^4.5.0",
|
"react-draggable": "^4.5.0",
|
||||||
"react-ga4": "^2.1.0",
|
|
||||||
"react-icons": "^5.5.0",
|
"react-icons": "^5.5.0",
|
||||||
"react-infinite-scroller": "^1.2.6",
|
"react-infinite-scroller": "^1.2.6",
|
||||||
"react-redux": "^9.2.0",
|
"react-redux": "^9.2.0",
|
||||||
@@ -4950,12 +4949,6 @@
|
|||||||
"react-dom": ">= 16.3.0"
|
"react-dom": ">= 16.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-ga4": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/react-ga4/-/react-ga4-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-ZKS7PGNFqqMd3PJ6+C2Jtz/o1iU9ggiy8Y8nUeksgVuvNISbmrQtJiZNvC/TjDsqD0QlU5Wkgs7i+w9+OjHhhQ==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/react-icons": {
|
"node_modules/react-icons": {
|
||||||
"version": "5.5.0",
|
"version": "5.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.5.0.tgz",
|
||||||
|
|||||||
@@ -39,7 +39,6 @@
|
|||||||
"react-device-detect": "^2.2.3",
|
"react-device-detect": "^2.2.3",
|
||||||
"react-dom": "^19.1.1",
|
"react-dom": "^19.1.1",
|
||||||
"react-draggable": "^4.5.0",
|
"react-draggable": "^4.5.0",
|
||||||
"react-ga4": "^2.1.0",
|
|
||||||
"react-icons": "^5.5.0",
|
"react-icons": "^5.5.0",
|
||||||
"react-infinite-scroller": "^1.2.6",
|
"react-infinite-scroller": "^1.2.6",
|
||||||
"react-redux": "^9.2.0",
|
"react-redux": "^9.2.0",
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ import { Notifications } from "@mantine/notifications"
|
|||||||
import type React from "react"
|
import type React from "react"
|
||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { isSafari } from "react-device-detect"
|
import { isSafari } from "react-device-detect"
|
||||||
import ReactGA from "react-ga4"
|
import { HashRouter, Navigate, Route, Routes, useNavigate } from "react-router-dom"
|
||||||
import { HashRouter, Navigate, Route, Routes, useLocation, useNavigate } from "react-router-dom"
|
|
||||||
import Tinycon from "tinycon"
|
import Tinycon from "tinycon"
|
||||||
import { Constants } from "@/app/constants"
|
import { Constants } from "@/app/constants"
|
||||||
import { redirectTo } from "@/app/redirect/slice"
|
import { redirectTo } from "@/app/redirect/slice"
|
||||||
@@ -125,21 +124,6 @@ function RedirectHandler() {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
function GoogleAnalyticsHandler() {
|
|
||||||
const location = useLocation()
|
|
||||||
const googleAnalyticsCode = useAppSelector(state => state.server.serverInfos?.googleAnalyticsCode)
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (googleAnalyticsCode) ReactGA.initialize(googleAnalyticsCode)
|
|
||||||
}, [googleAnalyticsCode])
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (ReactGA.isInitialized) ReactGA.send({ hitType: "pageview", page: location.pathname })
|
|
||||||
}, [location])
|
|
||||||
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
function UnreadCountTitleHandler({ enabled }: { enabled?: boolean }) {
|
function UnreadCountTitleHandler({ enabled }: { enabled?: boolean }) {
|
||||||
const root = useAppSelector(state => state.tree.rootCategory)
|
const root = useAppSelector(state => state.tree.rootCategory)
|
||||||
const unreadCount = categoryUnreadCount(root)
|
const unreadCount = categoryUnreadCount(root)
|
||||||
@@ -229,7 +213,6 @@ export function App() {
|
|||||||
{!isSafari && <DisablePullToRefresh />}
|
{!isSafari && <DisablePullToRefresh />}
|
||||||
|
|
||||||
<HashRouter>
|
<HashRouter>
|
||||||
<GoogleAnalyticsHandler />
|
|
||||||
<RedirectHandler />
|
<RedirectHandler />
|
||||||
<AppRoutes />
|
<AppRoutes />
|
||||||
</HashRouter>
|
</HashRouter>
|
||||||
|
|||||||
@@ -214,7 +214,6 @@ export interface ServerInfo {
|
|||||||
version: string
|
version: string
|
||||||
gitCommit: string
|
gitCommit: string
|
||||||
allowRegistrations: boolean
|
allowRegistrations: boolean
|
||||||
googleAnalyticsCode?: string
|
|
||||||
smtpEnabled: boolean
|
smtpEnabled: boolean
|
||||||
demoAccountEnabled: boolean
|
demoAccountEnabled: boolean
|
||||||
websocketEnabled: boolean
|
websocketEnabled: boolean
|
||||||
|
|||||||
@@ -51,11 +51,6 @@ public interface CommaFeedConfiguration {
|
|||||||
*/
|
*/
|
||||||
Optional<String> announcement();
|
Optional<String> announcement();
|
||||||
|
|
||||||
/**
|
|
||||||
* Google Analytics tracking code.
|
|
||||||
*/
|
|
||||||
Optional<String> googleAnalyticsTrackingCode();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Google Auth key for fetching Youtube channel favicons.
|
* Google Auth key for fetching Youtube channel favicons.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,9 +25,6 @@ public class ServerInfo implements Serializable {
|
|||||||
@Schema(required = true)
|
@Schema(required = true)
|
||||||
private boolean allowRegistrations;
|
private boolean allowRegistrations;
|
||||||
|
|
||||||
@Schema
|
|
||||||
private String googleAnalyticsCode;
|
|
||||||
|
|
||||||
@Schema(required = true)
|
@Schema(required = true)
|
||||||
private boolean smtpEnabled;
|
private boolean smtpEnabled;
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ public class ServerREST {
|
|||||||
infos.setVersion(version.getVersion());
|
infos.setVersion(version.getVersion());
|
||||||
infos.setGitCommit(version.getGitCommit());
|
infos.setGitCommit(version.getGitCommit());
|
||||||
infos.setAllowRegistrations(config.users().allowRegistrations());
|
infos.setAllowRegistrations(config.users().allowRegistrations());
|
||||||
infos.setGoogleAnalyticsCode(config.googleAnalyticsTrackingCode().orElse(null));
|
|
||||||
infos.setSmtpEnabled(config.passwordRecoveryEnabled());
|
infos.setSmtpEnabled(config.passwordRecoveryEnabled());
|
||||||
infos.setDemoAccountEnabled(config.users().createDemoAccount());
|
infos.setDemoAccountEnabled(config.users().createDemoAccount());
|
||||||
infos.setWebsocketEnabled(config.websocket().enabled());
|
infos.setWebsocketEnabled(config.websocket().enabled());
|
||||||
|
|||||||
Reference in New Issue
Block a user