bugfix: download mod not reload installedMods list

This commit is contained in:
knoxfighter 2017-09-28 01:06:42 +02:00
parent 3ee1842344
commit f8d5a78c09
2 changed files with 5 additions and 2 deletions

View File

@ -169,6 +169,7 @@ func ModPortalInstallHandler(w http.ResponseWriter, r *http.Request) {
return
}
resp.Data = mods.listInstalledMods()
resp.Success = true
if err := json.NewEncoder(w).Encode(resp); err != nil {

View File

@ -85,6 +85,8 @@ class ModsContent extends React.Component {
let filename = $checked_input.data("filename");
let mod_name = $checked_input.data("modid");
let this_class = this;
$.ajax({
method: "POST",
url: "/api/mods/install",
@ -97,8 +99,8 @@ class ModsContent extends React.Component {
modName: mod_name
},
success: (data) => {
this.setState({
installedMods: data.data
this_class.setState({
installedMods: data.data.mods
})
swal({