main.tsx (1001B)
1 import { initAsync, start } from "@mtrnord/matrix-sdk-crypto-js"; 2 import React from 'react' 3 import { createRoot } from 'react-dom/client'; 4 import './index.scss'; 5 import ReactModal from "react-modal"; 6 7 initAsync().then(() => { 8 // if (Tracing.isAvailable()) { 9 // console.log("Tracing is available, turning on"); 10 // let tracing = new Tracing(LoggerLevel.Info); 11 // tracing.turnOn(); 12 // } 13 console.log("Crypto starting") 14 start(); 15 console.log("Crypto started") 16 17 import('./app/sdk/client').then(({ MatrixContext, defaultMatrixClient }) => { 18 import('./App').then(({ default: App }) => { 19 console.log("Starting App") 20 const container = document.getElementById('root')!; 21 const root = createRoot(container); 22 23 ReactModal.setAppElement('#root'); 24 25 root.render( 26 <React.StrictMode> 27 <MatrixContext.Provider value={defaultMatrixClient}> 28 <App /> 29 </MatrixContext.Provider> 30 </React.StrictMode> 31 ); 32 }) 33 34 }) 35 })