fix(wallpaper): set the category on adding a folder

This commit is contained in:
Michael Aaron Murphy 2023-12-14 04:16:46 +01:00
parent 2be76211e8
commit 2c72c1e5fd
No known key found for this signature in database
GPG key ID: B2732D4240C9212C

View file

@ -142,9 +142,11 @@ impl page::Page<crate::pages::Message> for Page {
ActiveDialog::AddFolder => {
if path.is_dir() {
self.add_recent_folder(path.clone());
let _res = self.config.set_current_folder(Some(path.clone()));
let id = self.config.recent_folders().len() - 1;
self.categories.selected = Some(Category::RecentFolder(id));
return cosmic::command::future(async move {
crate::pages::Message::DesktopWallpaper(Message::ChangeFolder(
change_folder(path).await,
@ -166,7 +168,9 @@ impl page::Page<crate::pages::Message> for Page {
}
}
ActiveDialog::None => (),
ActiveDialog::None => {
tracing::error!("not actively handling a dialog");
},
}
}