refactor: dont inject analytics script

This commit is contained in:
2024-01-09 10:30:45 +00:00
parent 44983068e4
commit 45245153ab
5 changed files with 54 additions and 39 deletions

View File

@ -46,12 +46,6 @@ import WalletPage from "./Pages/wallet";
import { WalletReceivePage } from "./Pages/wallet/receive";
import { WalletSendPage } from "./Pages/wallet/send";
declare global {
interface Window {
plausible?: (tag: string, e?: object) => void;
}
}
serviceWorkerRegistration.register();
async function initSite() {
@ -77,16 +71,6 @@ async function initSite() {
console.error("Failed to register protocol handler", e);
}
// inject analytics script
// <script defer data-domain="snort.social" src="http://analytics.v0l.io/js/script.js"></script>
if (CONFIG.features.analytics && (login.appData.item.preferences.telemetry ?? true)) {
const sc = document.createElement("script");
sc.src = "https://analytics.v0l.io/js/script.js";
sc.defer = true;
sc.setAttribute("data-domain", CONFIG.hostname);
document.head.appendChild(sc);
}
setupWebLNWalletConfig(Wallets);
return null;
}