Skip to content

Commit

Permalink
update public directory
Browse files Browse the repository at this point in the history
  • Loading branch information
wheattoast11 committed Nov 30, 2024
1 parent 216a276 commit 022223d
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 40 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
9 changes: 2 additions & 7 deletions site.webmanifest → public/site.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@
"theme_color": "#7A9E9F",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"src": "/favicon-32x32.png",
"sizes": "32x32",
"type": "image/png"
}
]
Expand Down
File renamed without changes.
45 changes: 13 additions & 32 deletions src/components/ErrorBoundary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@ class ErrorBoundary extends React.Component {
}

static getDerivedStateFromError(error) {
return { hasError: true };
if (error && !error.message?.includes('Failed to load resource')) {
return { hasError: true };
}
return null;
}

componentDidCatch(error, errorInfo) {
// Log error to console for debugging
console.error('ErrorBoundary caught an error:', error);
console.error('Error Info:', errorInfo);

this.setState({
error: error,
errorInfo: errorInfo
});
if (error && !error.message?.includes('Failed to load resource')) {
console.error('ErrorBoundary caught an error:', error);
console.error('Error Info:', errorInfo);

this.setState({
error: error,
errorInfo: errorInfo
});
}
}

render() {
Expand All @@ -43,29 +47,6 @@ class ErrorBoundary extends React.Component {
<div>
<h1>Something went wrong</h1>
<p>Please refresh the page or try again later.</p>
{process.env.NODE_ENV === 'development' && (
<div style={{
marginTop: '2rem',
textAlign: 'left',
maxWidth: '800px'
}}>
<details>
<summary style={{ cursor: 'pointer', marginBottom: '1rem' }}>
Error Details
</summary>
<pre style={{
whiteSpace: 'pre-wrap',
wordBreak: 'break-word',
background: '#111',
padding: '1rem',
borderRadius: '4px'
}}>
{this.state.error && this.state.error.toString()}
{this.state.errorInfo && this.state.errorInfo.componentStack}
</pre>
</details>
</div>
)}
</div>
</div>
);
Expand Down
4 changes: 3 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ export default defineConfig({
},
optimizeDeps: {
include: ['three', 'framer-motion', 'pts']
}
},
publicDir: 'public',
assetsInclude: ['**/*.png', '**/*.ico', '**/*.webmanifest']
});

0 comments on commit 022223d

Please sign in to comment.