diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index d088b93..d1455f8 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -107,9 +107,9 @@ async fn parse_args(inp: &Vec) -> Result { if game_path.is_some() { if args.value_of("non-elevated-game")? { - system_helpers::run_un_elevated(game_path.unwrap().to_string(), Some(game_args)) + system_helpers::run_un_elevated(game_path.unwrap(), Some(game_args)) } else { - system_helpers::run_program(game_path.unwrap().to_string(), Some(game_args)) + system_helpers::run_program(game_path.unwrap(), Some(game_args)) } } } diff --git a/src-tauri/src/patch.rs b/src-tauri/src/patch.rs index 789eaef..66c7bcc 100644 --- a/src-tauri/src/patch.rs +++ b/src-tauri/src/patch.rs @@ -53,9 +53,7 @@ pub async fn unpatch_game() -> bool { pub async fn get_game_rsa_path() -> Option { let config = config::get_config(); - if config.game_install_path.is_none() { - return None; - } + config.game_install_path.as_ref()?; let mut game_folder = PathBuf::from(config.game_install_path.unwrap()); game_folder.pop(); diff --git a/src-tauri/src/release.rs b/src-tauri/src/release.rs index 647f454..4341ba1 100644 --- a/src-tauri/src/release.rs +++ b/src-tauri/src/release.rs @@ -6,8 +6,7 @@ pub struct Release { #[tauri::command] pub async fn get_latest_release() -> Release { - // NotThorny edition requests to repo so as to avoid update spam from official repo -alpha version diff. - let url = "https://api.github.com/repos/NotThorny/Cultivation/releases/latest"; + let url = "https://api.github.com/repos/Grasscutters/Cultivation/releases/latest"; let client = reqwest::Client::new(); let response = client .get(url) @@ -17,6 +16,7 @@ pub async fn get_latest_release() -> Release { .unwrap(); let text = response.text().await.unwrap(); + // This includes ip when github rate limits you, so avoid it for now to avoid leaks through screenshots //println!("Response: {}", text); // Parse "tag_name" from JSON diff --git a/src-tauri/src/system_helpers.rs b/src-tauri/src/system_helpers.rs index ff8bddf..f25e193 100644 --- a/src-tauri/src/system_helpers.rs +++ b/src-tauri/src/system_helpers.rs @@ -230,7 +230,7 @@ pub fn service_status(service: String) -> bool { } }; let status_result = my_service.query_status(); - if status_result.is_ok() { + if let Ok(..) = status_result { let status = status_result.unwrap(); println!("{} service status: {:?}", service, status.current_state); if status.current_state == Stopped { diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 6bc39a5..9dc97f7 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "Cultivation", - "version": "1.0.26" + "version": "1.0.27" }, "tauri": { "allowlist": { diff --git a/src/ui/Mods.tsx b/src/ui/Mods.tsx index dd1e8f7..4d13ae8 100644 --- a/src/ui/Mods.tsx +++ b/src/ui/Mods.tsx @@ -143,12 +143,13 @@ export class Mods extends React.Component { } async setSearch(text: string) { - if(this.timeout) clearTimeout(this.timeout); + if (this.timeout) clearTimeout(this.timeout) this.timeout = window.setTimeout(() => { - this.setState({ - search: text, - }, - this.forceUpdate + this.setState( + { + search: text, + }, + this.forceUpdate ) }, 300) } @@ -207,13 +208,15 @@ export class Mods extends React.Component { {this.state.category != 'installed' && ( <>
- {this.setSearch(text)}} + onChange={(text: string) => { + this.setSearch(text) + }} initalValue={''} - /> + />
diff --git a/src/ui/components/mods/ModList.tsx b/src/ui/components/mods/ModList.tsx index 5aaea37..91552f7 100644 --- a/src/ui/components/mods/ModList.tsx +++ b/src/ui/components/mods/ModList.tsx @@ -17,11 +17,11 @@ interface IState { horny: boolean modList: ModData[] | null installedList: - | { - path: string - info: ModData | PartialModData - }[] - | null + | { + path: string + info: ModData | PartialModData + }[] + | null } export class ModList extends React.Component { @@ -68,7 +68,9 @@ export class ModList extends React.Component { if (!(this.props.search == '')) { // idk the api so just filter all mods to search - mods = (await getAllMods(this.props.mode)).filter(mod => mod.name.toLowerCase().includes(this.props.search.toLowerCase())) + mods = (await getAllMods(this.props.mode)).filter((mod) => + mod.name.toLowerCase().includes(this.props.search.toLowerCase()) + ) } else { mods = await getMods(this.props.mode, this.props.page) } @@ -89,21 +91,21 @@ export class ModList extends React.Component { return (
{(this.state.modList && this.props.mode !== 'installed') || - (this.state.installedList && this.props.mode === 'installed') ? ( + (this.state.installedList && this.props.mode === 'installed') ? (
{this.props.mode === 'installed' ? this.state.installedList?.map((mod) => ( - - )) + + )) : this.state.modList?.map((mod: ModData) => ( - - ))} + + ))}
) : ( diff --git a/src/ui/components/news/NewsSection.tsx b/src/ui/components/news/NewsSection.tsx index fa89803..237266b 100644 --- a/src/ui/components/news/NewsSection.tsx +++ b/src/ui/components/news/NewsSection.tsx @@ -124,7 +124,7 @@ export default class NewsSection extends React.Component { case 'latest_version': news = ( - Latest version: Grasscutter 1.4.8 - Cultivation 1.0.26 + Latest version: Grasscutter 1.4.8 - Cultivation 1.0.27 ) break