Skip to content

Commit

Permalink
Move update check to new thread (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
Coolsonickirby authored Dec 10, 2022
1 parent 7f3fe59 commit fe0b3a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,12 @@ fn initial_loading(_ctx: &InlineCtx) {

// Begin checking if there is an update to do. We do this in a separate thread so that we can install the hooks while we are waiting on GitHub response
#[cfg(feature = "online")]
check_for_update();
let _updater = std::thread::Builder::new()
.stack_size(0x10000)
.spawn(|| {
check_for_update();
})
.unwrap();

// Commented out until we get an actual news server
// #[cfg(feature = "online")]
Expand Down Expand Up @@ -283,6 +288,9 @@ fn initial_loading(_ctx: &InlineCtx) {
drop(filesystem);
fuse::mods::install_mod_fs();
api::event::send_event(Event::ModFilesystemMounted);

#[cfg(feature = "online")]
_updater.join().unwrap();
}

#[skyline::hook(offset = offsets::title_screen_version())]
Expand Down
2 changes: 1 addition & 1 deletion src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ where
let day = &split[2][..2];
format!("{}/{}/{}", month, day, year)
};
let header_text = format!("{} ({})", release.get_release_tag().trim_start_matches('v'), &release.data["name"].to_string());
let header_text = format!("{} ({})", release.get_release_tag().trim_start_matches('v'), &release.data["name"].to_string().trim_matches('\"'));
if !f(&header_text, date, &release.data["body"].to_string()) {
return
}
Expand Down

0 comments on commit fe0b3a9

Please sign in to comment.