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!

fix destroy call

kruzhambus947aee97da17
diff --git a/src/pages/Project/View/ViewProject.jsx b/src/pages/Project/View/ViewProject.jsx
index 393f610c2..a4e5d5134 100644
--- a/src/pages/Project/View/ViewProject.jsx
+++ b/src/pages/Project/View/ViewProject.jsx
@@ -313,7 +313,7 @@ const ViewProject = ({
// Initialising Swetrix SDK instance
useEffect(() => {
- let sdk
+ let sdk = null
if (!_isEmpty(extensions)) {
const processedExtensions = _map(extensions, (ext) => {
const { id: extId, fileURL } = ext
@@ -357,8 +357,8 @@ const ViewProject = ({
}
return () => {
- if (!_isEmpty(sdk)) {
- sdk.destroy()
+ if (sdk) {
+ sdk._destroy()
}
}
}, [extensions])