refactor: Improve Gitea API error reporting and proxy logging, update tab content display, and add Globe texture cleanup.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user