EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
main.jsx
Go to the documentation of this file.
1
2import { StrictMode } from 'react'
3import { createRoot } from 'react-dom/client'
4import './index.css'
5// load the global fetch wrapper early so all components use it
6import './utils/api'
7import './styles/theme.css'
8import './styles/themes.css'
9import { initTheme } from './utils/themeManager'
10import App from './App.jsx'
11
12// Import Quill JS and CSS from npm for Quill 2.x
13import 'quill';
14import 'quill/dist/quill.snow.css';
15
16// One-time cleanup: Remove quotes from corrupted tenant_id in localStorage
17// (Fix for issue where tenant_id had trailing quotes causing 500 errors)
18try {
19 const tid = localStorage.getItem('selectedTenantId');
20 if (tid && (tid.includes("'") || tid.includes('"'))) {
21 const cleaned = tid.trim().replace(/['"]/g, '');
22 localStorage.setItem('selectedTenantId', cleaned);
23 console.log('[localStorage] Cleaned corrupted tenant_id:', tid, '→', cleaned);
24 }
25} catch (err) {
26 console.warn('[localStorage] Failed to clean tenant_id:', err);
27}
28
29// initialize theme (reads saved settings or server)
30initTheme().finally(() => {
31 createRoot(document.getElementById('root')).render(
32 <StrictMode>
33 <App />
34 </StrictMode>,
35 )
36})