diff --git a/src/canvas/Globe.jsx b/src/canvas/Globe.jsx index b31ece3..2971310 100644 --- a/src/canvas/Globe.jsx +++ b/src/canvas/Globe.jsx @@ -21,12 +21,13 @@ const GlobeMesh = () => { // Detect mobile device and reduce polygon count accordingly const isMobile = useMemo(() => { - return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || - (window.innerWidth <= 768); + return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || + (window.innerWidth <= 768); }, []); // Generate Borders Texture using D3 useEffect(() => { + let texture = null; const generateTexture = async () => { try { // Fetch World Topology (small 110m res) @@ -55,7 +56,7 @@ const GlobeMesh = () => { context.stroke(); // Create Texture - const texture = new THREE.CanvasTexture(canvas); + texture = new THREE.CanvasTexture(canvas); texture.needsUpdate = true; setBordersTexture(texture); } catch (err) { @@ -64,6 +65,10 @@ const GlobeMesh = () => { }; generateTexture(); + + return () => { + if (texture) texture.dispose(); + }; }, []); // Ireland Coordinates diff --git a/src/components/ActivityHeatmap.jsx b/src/components/ActivityHeatmap.jsx index d987b64..64f0052 100644 --- a/src/components/ActivityHeatmap.jsx +++ b/src/components/ActivityHeatmap.jsx @@ -37,6 +37,7 @@ const ActivityHeatmap = () => { } } catch (e) { console.warn("Gitea API error:", e); + console.error('Failed to fetch Gitea heatmap. URL:', '/api/gitea/api/v1/users/Matiss/heatmap'); } // 3. Process & Merge diff --git a/src/components/GitHistory.jsx b/src/components/GitHistory.jsx index 223487e..d730fc9 100644 --- a/src/components/GitHistory.jsx +++ b/src/components/GitHistory.jsx @@ -61,6 +61,7 @@ const GitHistory = () => { return commitsArrays.flat(); } catch (err) { console.warn('Gitea history error:', err); + console.error('Failed to fetch Gitea history. Check if the proxy is correctly configured and the target URL is reachable.'); return []; } }; diff --git a/src/components/InfoTabs.jsx b/src/components/InfoTabs.jsx index 079cd48..8307e03 100644 --- a/src/components/InfoTabs.jsx +++ b/src/components/InfoTabs.jsx @@ -53,8 +53,12 @@ const InfoTabs = () => { {/* Content Area */}
- {activeTab === 'location' && } - {activeTab === 'git' && } +
+ +
+
+ +
); diff --git a/vite.config.js b/vite.config.js index 9114c28..31352cb 100644 --- a/vite.config.js +++ b/vite.config.js @@ -9,7 +9,19 @@ export default defineConfig({ '/api/gitea': { target: 'https://git.mati.ss', changeOrigin: true, - rewrite: (path) => path.replace(/^\/api\/gitea/, '') + secure: false, + rewrite: (path) => path.replace(/^\/api\/gitea/, ''), + configure: (proxy, _options) => { + proxy.on('error', (err, _req, _res) => { + console.log('proxy error', err); + }); + proxy.on('proxyReq', (proxyReq, req, _res) => { + console.log('Sending Request to the Target:', req.method, req.url); + }); + proxy.on('proxyRes', (proxyRes, req, _res) => { + console.log('Received Response from the Target:', proxyRes.statusCode, req.url); + }); + }, } } }