mirror of
https://github.com/yairm210/Unciv.git
synced 2024-12-22 15:54:25 +07:00
Fix ANR caused by URL checking for Github URL with query
This commit is contained in:
parent
992100412d
commit
5e6a3e0f67
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user