-
Notifications
You must be signed in to change notification settings - Fork 54
fix: prettier #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: prettier #277
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,36 @@ import { createRoot } from "react-dom/client"; | |
import App from "./App.tsx"; | ||
|
||
import "./index.css"; | ||
import { init } from "@dojoengine/sdk"; | ||
import { Schema, schema } from "./bindings.ts"; | ||
import { dojoConfig } from "../dojoConfig.ts"; | ||
|
||
createRoot(document.getElementById("root")!).render( | ||
<StrictMode> | ||
<App /> | ||
</StrictMode> | ||
); | ||
async function main() { | ||
const db = await init<Schema>( | ||
{ | ||
client: { | ||
rpcUrl: dojoConfig.rpcUrl, | ||
toriiUrl: dojoConfig.toriiUrl, | ||
relayUrl: dojoConfig.relayUrl, | ||
worldAddress: dojoConfig.manifest.world.address, | ||
}, | ||
domain: { | ||
name: "Example", | ||
version: "1.0", | ||
chainId: "your-chain-id", | ||
revision: "1", | ||
}, | ||
}, | ||
schema | ||
); | ||
|
||
createRoot(document.getElementById("root")!).render( | ||
<StrictMode> | ||
<App db={db} /> | ||
</StrictMode> | ||
); | ||
} | ||
Comment on lines
+11
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider handling initialization within React components. Initializing the database before rendering delays the application's initial render, which may lead to a blank screen during the wait. To improve user experience, consider moving the initialization logic inside the |
||
|
||
main().catch((error) => { | ||
console.error("Failed to initialize the application:", error); | ||
}); | ||
Comment on lines
+37
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance user feedback on initialization failure. If the application fails to initialize, the error is only logged to the console. Consider providing a user-friendly error message or rendering a fallback UI to inform the user about the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace placeholder
chainId
with the actual value.The
chainId
is currently set to"your-chain-id"
. Please update this to the correct chain ID for your environment to ensure proper connectivity and functionality.