Clean up package page when opened

This commit is contained in:
Victor Fuentes 2022-11-27 15:38:52 -05:00
parent 1262c97284
commit b5bce18a6e
No known key found for this signature in database
GPG Key ID: 0A88B68D6A9ACAE0

View File

@ -1050,6 +1050,15 @@ impl Component for PkgModel {
self.installworker.emit(InstallAsyncHandlerMsg::SetPkgTypes(syspkgs, userpkgs));
}
PkgMsg::Open(pkgmodel) => {
// First clean up from previous package
self.summary = None;
self.description = None;
self.icon = None;
let mut scrn_guard = self.screenshots.guard();
scrn_guard.clear();
scrn_guard.drop();
self.set_visible(true);
self.set_pkg(pkgmodel.pkg);
self.set_name(pkgmodel.name);
@ -1273,13 +1282,6 @@ impl Component for PkgModel {
}
}
PkgMsg::Close => {
// self.pkg = String::default();
// self.name = String::default();
// self.summary = None;
// self.description = None;
// self.icon = None;
// let mut scrn_guard = self.screenshots.guard();
// scrn_guard.clear();
self.set_visible(false);
sender.output(AppMsg::FrontPage)
}