Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
fix: coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
johanmontorfano committed Jul 29, 2024
1 parent 3c79a16 commit 42e8836
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions comfy/src/game_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,15 @@ pub async fn run_comfy_main_async(
web_sys::window()
.and_then(|win| win.document())
.and_then(|doc| {
let canvas = web_sys::Element::from(window.canvas().unwrap());

match &game_config().wasm_append_id {
Some(id) => {
let dst = doc.get_element_by_id(&id)?;
let canvas =
web_sys::Element::from(window.canvas().unwrap());
dst.append_child(&canvas).ok()?;
}
_ => {
let dst = doc.body()?;
let canvas = web_sys::
Element::from(window.canvas().unwrap());
dst.append_child(&canvas).ok()?;
}
};
Expand Down

0 comments on commit 42e8836

Please sign in to comment.