diff --git a/core/src/com/unciv/ui/screens/modmanager/ModManagementScreen.kt b/core/src/com/unciv/ui/screens/modmanager/ModManagementScreen.kt index d830b963a0..dcc15b6f96 100644 --- a/core/src/com/unciv/ui/screens/modmanager/ModManagementScreen.kt +++ b/core/src/com/unciv/ui/screens/modmanager/ModManagementScreen.kt @@ -414,15 +414,19 @@ class ModManagementScreen private constructor( actualDownloadButton.onClick { actualDownloadButton.setText("Downloading...".tr()) actualDownloadButton.disable() - val repo = GithubAPI.Repo.parseUrl(textField.text) - if (repo == null) { - ToastPopup("«RED»{Invalid link!}«»", this@ModManagementScreen) - actualDownloadButton.setText("Download".tr()) - actualDownloadButton.enable() - } else - downloadMod(repo, { - actualDownloadButton.setText("{Downloading...} ${it}%".tr()) - }) { popup.close() } + Concurrency.run { + val repo = GithubAPI.Repo.parseUrl(textField.text) + if (repo == null) { + Concurrency.runOnGLThread { + ToastPopup("«RED»{Invalid link!}«»", this@ModManagementScreen) + actualDownloadButton.setText("Download".tr()) + actualDownloadButton.enable() + } + } else + downloadMod(repo, { + actualDownloadButton.setText("{Downloading...} ${it}%".tr()) + }) { popup.close() } + } } popup.add(actualDownloadButton).row() popup.addCloseButton()