diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 14548e2..b7a8f8b 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -51,7 +51,11 @@ fn disconnect() { #[tauri::command] fn run_program(path: String) { // Open the program from the specified path. - match open::that(path) { + // match open::that(path) { + // Ok(_) => (), + // Err(e) => println!("Failed to open program: {}", e), + // }; + match open::with(format!("/c \"{}\"", &path), "C:\\Windows\\System32\\cmd.exe") { Ok(_) => (), Err(e) => println!("Failed to open program: {}", e), }; diff --git a/src/ui/components/news/NewsSection.tsx b/src/ui/components/news/NewsSection.tsx index eab50fb..78cfdba 100644 --- a/src/ui/components/news/NewsSection.tsx +++ b/src/ui/components/news/NewsSection.tsx @@ -42,8 +42,14 @@ export default class NewsSection extends React.Component { async showLatestCommits() { if (!this.state.commitList) { - const commits: string = await invoke('req_get', { url: 'https://api.github.com/repos/Grasscutters/Grasscutter/commits' }) - const obj = JSON.parse(commits) + const commits: string = await invoke('req_get', { url: 'https://api.grasscutters.xyz/cultivation/query' }) + let obj = JSON.parse(commits) + + // If it didn't work, use official API + if (!obj.commits) { + const commits: string = await invoke('req_get', { url: 'https://api.github.com/repos/Grasscutters/Grasscutter/commits' }) + obj = JSON.parse(commits) + } // Probably rate-limited if (!Array.isArray(obj)) return