diff --git a/package.json b/package.json index b7fd0d9..63ed9bd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "saturn-launcher", "private": true, - "version": "0.1.1", + "version": "0.1.3", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 0f8f23b..cf99fbe 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -3887,7 +3887,7 @@ dependencies = [ [[package]] name = "saturn-launcher" -version = "0.1.1" +version = "0.1.3" dependencies = [ "futures", "lyceris", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index aaa4454..2074270 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "saturn-launcher" -version = "0.1.1" +version = "0.1.3" description = "A minecraft launcher for Saturn Client" authors = ["SaturnClient"] edition = "2021" diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 613b035..04452c0 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -53,7 +53,7 @@ impl Default for AppState { max_memory: 2048, features: FeatureSettings::default(), }, - version: String::from("1.21.6"), + version: String::from("1.21.11"), } } } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2240a4c..03ee408 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "saturn-launcher", - "version": "0.1.1", + "version": "0.1.3", "identifier": "org.saturnclient.saturn-launcher", "build": { "beforeDevCommand": "npm run dev", @@ -12,7 +12,7 @@ "app": { "windows": [ { - "title": "Saturn Launcher v0.1.1", + "title": "Saturn Launcher v0.1.3", "width": 1000, "height": 650, "backgroundColor": "#0a0a0a", diff --git a/src/components/ModsSection.tsx b/src/components/ModsSection.tsx index e075db2..bff82ff 100644 --- a/src/components/ModsSection.tsx +++ b/src/components/ModsSection.tsx @@ -22,6 +22,7 @@ import { motion, AnimatePresence } from "framer-motion"; import { GameVersion, Mod } from "@/lib/types"; import { versions } from "@/lib/launcher"; import toast from "react-hot-toast"; +import { useRef } from "react"; function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); @@ -44,18 +45,21 @@ const ModsSection: React.FC = ({ version }) => { string[] >([]); + const requestIdRef = useRef(0); + const loadMods = async () => { + const requestId = ++requestIdRef.current; + if (activeTab === "installed") { const m = await getInstalledMods(version.id); - setMods(m); - if (activeTab === "installed") { - // Fix: If discover mods takes too long and the user switches tabs it glitches + + if (requestId === requestIdRef.current) { setMods(m); } } else { const m = await discoverMods(searchQuery); - if (activeTab === "discover") { - // Fix: If discover mods takes too long and the user switches tabs it glitches + + if (requestId === requestIdRef.current) { setMods(m); } } diff --git a/src/lib/launcher.ts b/src/lib/launcher.ts index af4f3dc..4bba980 100644 --- a/src/lib/launcher.ts +++ b/src/lib/launcher.ts @@ -6,17 +6,42 @@ export const versions: GameVersion[] = [ { id: "1.21.4", name: "Fabric 1.21.4", - loader_version: "0.18.6", + loader_version: "0.19.0", }, { id: "1.21.5", name: "Fabric 1.21.5", - loader_version: "0.18.6", + loader_version: "0.19.0", }, { id: "1.21.6", name: "Fabric 1.21.6", - loader_version: "0.18.6", + loader_version: "0.19.0", + }, + { + id: "1.21.7", + name: "Fabric 1.21.7", + loader_version: "0.19.0", + }, + { + id: "1.21.8", + name: "Fabric 1.21.8", + loader_version: "0.19.0", + }, + { + id: "1.21.9", + name: "Fabric 1.21.9", + loader_version: "0.19.0", + }, + { + id: "1.21.10", + name: "Fabric 1.21.10", + loader_version: "0.19.0", + }, + { + id: "1.21.11", + name: "Fabric 1.21.11", + loader_version: "0.19.0", }, ];