Skip to content

Commit

Permalink
Fix update crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
squ1dd13 committed Dec 30, 2022
1 parent 8b28d8e commit 6f72ba0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cleo"
version = "2.2.1"
version = "2.2.2"
authors = ["squ1dd13 <squ1dd13dev@gmail.com>"]
edition = "2021"
description = "CLEO SA for iOS"
Expand Down
2 changes: 1 addition & 1 deletion deb/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Depends: mobilesubstrate
Provides: com.squ1dd13.csios, com.squ1dd13.zinc
Conflicts: com.squ1dd13.csios, com.squ1dd13.zinc, com.brend0n.gtasa60fps
Replaces: com.squ1dd13.csios, com.squ1dd13.zinc
Version: 2.2.1
Version: 2.2.2
Architecture: iphoneos-arm
Description: CLEO for GTA:SA. Now with extra Rust!
Maintainer: squ1dd13
Expand Down
10 changes: 5 additions & 5 deletions src/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ fn user_wants_alpha() -> bool {
matches!(Options::get().release_channel, ReleaseChannel::Alpha)
}

/// Returns the most stable version of CLEO after or including the given version.
fn most_stable_from(min_ver: Version) -> Result<Option<(Version, String)>> {
/// Returns the most stable version of CLEO after the given version.
fn most_stable_after(min_ver: Version) -> Result<Option<(Version, String)>> {
Ok(fetch_releases()?
.into_iter()
// Only include releases that are newer than or the same as the given version.
.filter(|(version, _)| version >= &min_ver)
// Only include releases that are newer than the given version.
.filter(|(version, _)| version > &min_ver)
// Find a stable version, or just take the first version available. The releases are sorted
// in descending order by version number, so if we can't find a stable release then we just
// use whatever the latest version is and assume that it's the most stable.
Expand All @@ -286,7 +286,7 @@ fn fetch_available_update() -> Result<Option<(Version, String)>> {
// If the user doesn't want to receive alpha updates, get them on the most stable version.
// If they're already on an alpha version, this will update them to the latest alpha, with
// the idea being that a newer alpha will be more stable.
return most_stable_from(current_version);
return most_stable_after(current_version);
}

// If the user wants to receive alpha updates, just find the latest version, regardless of
Expand Down
4 changes: 2 additions & 2 deletions src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ fn show_update_prompt(screen: *mut u8, (update_ver, update_url): (Version, Strin
}

fn on_no(raw_url_box: usize) {
let url = unbox_string(raw_url_box);
// let url = unbox_string(raw_url_box);

log::info!("User rejected update. URL was {}.", url);
// log::info!("User rejected update. URL was {}.", url);
}

show_yes_no_menu(
Expand Down

0 comments on commit 6f72ba0

Please sign in to comment.