fix(wallpaper): prevent adding same image path multiple times

This commit is contained in:
md 2026-02-21 01:38:25 +05:30 committed by Jacob Kauffmann
parent eb8d0e349f
commit 28c3510671

View file

@ -1154,6 +1154,10 @@ impl Context {
}
fn add_custom_image(&mut self, path: PathBuf, display: Image, selection: ImageHandle) {
if self.paths.values().any(|p| p == &path) {
return;
}
let key = self.paths.insert(path);
self.is_custom.insert(key, ());
self.display_images.insert(key, display);