Improved mod install verbosity
This commit is contained in:
@@ -21,6 +21,7 @@ import { twMerge } from "tailwind-merge";
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
import { GameVersion, Mod } from "@/lib/types";
|
||||
import { versions } from "@/lib/launcher";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
@@ -90,12 +91,17 @@ const ModsSection: React.FC<ModsSectionProps> = ({ version }) => {
|
||||
|
||||
const handleInstall = async () => {
|
||||
if (selectedModForInstall && selectedVersionsForInstall.length > 0) {
|
||||
await installMod(selectedModForInstall, selectedVersionsForInstall);
|
||||
setIsInstallDialogOpen(false);
|
||||
toast.promise(installMod(selectedModForInstall, selectedVersionsForInstall), {
|
||||
loading: `Installing mod: ${selectedModForInstall.name}`,
|
||||
success: `Mod sucessfully installed: ${selectedModForInstall.name}`,
|
||||
error: (e) => `${selectedModForInstall.name} Failed: ${e}`
|
||||
}).then(async () => {
|
||||
if (activeTab === "installed") {
|
||||
const m = await getInstalledMods(version.id);
|
||||
setMods(m);
|
||||
}
|
||||
}).catch(console.error);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user