Skip to content

Commit

Permalink
Fix games not updating on deletion
Browse files Browse the repository at this point in the history
As reported by @random-geek
  • Loading branch information
rubenwardy committed Feb 18, 2019
1 parent cc9bed9 commit 5751762
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion builtin/mainmenu/dlg_delete_content.lua
Expand Up @@ -40,7 +40,12 @@ local function delete_content_buttonhandler(this, fields)
if not core.delete_dir(this.data.content.path) then
gamedata.errormessage = fgettext("pkgmgr: failed to delete \"$1\"", this.data.content.path)
end
pkgmgr.refresh_globals()

if this.data.content.type == "game" then
pkgmgr.update_gamelist()
else
pkgmgr.refresh_globals()
end
else
gamedata.errormessage = fgettext("pkgmgr: invalid path \"$1\"", this.data.content.path)
end
Expand Down

5 comments on commit 5751762

@p-ouellette
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this fix? update_gamelist was already being called by the content tab's on_change.

@rubenwardy
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only if games is nil

if pkgmgr.games == nil then
	pkgmgr.update_gamelist()
end

@p-ouellette
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant this:

on_change = pkgmgr.update_gamelist

Which is called when the delete dialog is closed.

@rubenwardy
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I did this based on a report by @random-geek. Maybe they meant the game bar, and not the content tab

@random-geek
Copy link
Contributor

@random-geek random-geek commented on 5751762 Feb 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, everything works now @rubenwardy :)

Please sign in to comment.