From b578362de216142959ef9511510c06d5446e355f Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Wed, 14 Aug 2024 19:57:47 +0200 Subject: chore: display alert when mod install via protocol cannot be resolved --- src/app/js/mods.js | 5 +++-- src/lang/en.json | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/js/mods.js b/src/app/js/mods.js index 349f5b9..bca417e 100644 --- a/src/app/js/mods.js +++ b/src/app/js/mods.js @@ -1,3 +1,4 @@ +const util = require('util'); const ipcRenderer = require("electron").ipcRenderer; const lang = require("../../lang"); @@ -338,13 +339,13 @@ ipcRenderer.on("protocol-install-mod", async (event, data) => { const package = packages.find((package) => { return package.owner == author && package.name == package_name; }) if (!package) { - console.error("Couldn't find package") + alert(util.format(lang("gui.mods.cant_find_specific"), author, package_name)); return; } const package_obj = package.versions.find((package_version) => { return package_version.version_number == version; }) if (!package_obj) { - console.error("Couldn't find package_version") + alert(util.format(lang("gui.mods.cant_find_version"), version, author, package_name)) return; } diff --git a/src/lang/en.json b/src/lang/en.json index d07d60f..0c44198 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -101,6 +101,8 @@ "installed_mod": "Installed mod!", "drag_n_drop": "Drag and drop a mod to install", "confirm_dependencies": "This package has dependencies, shown below, clicking \"Ok\" will install the package and the dependencies.\n\n", + "cant_find_specific": "Can't find mod %s-%s!", + "cant_find_version": "Can't find version %s of mod %s-%s!", "confirm_plugins": { "title": "The following package has native plugins:", -- cgit v1.2.3