Skip to content

Commit d5baa6d

Browse files
committed
fix(wallpaper): prevent adding same image path multiple times
1 parent 58a1af9 commit d5baa6d

File tree

1 file changed

+4
-0
lines changed
  • cosmic-settings/src/pages/desktop/wallpaper

1 file changed

+4
-0
lines changed

cosmic-settings/src/pages/desktop/wallpaper/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,10 @@ impl Context {
11541154
}
11551155

11561156
fn add_custom_image(&mut self, path: PathBuf, display: Image, selection: ImageHandle) {
1157+
if self.paths.values().any(|p| p == &path) {
1158+
return;
1159+
}
1160+
11571161
let key = self.paths.insert(path);
11581162
self.is_custom.insert(key, ());
11591163
self.display_images.insert(key, display);

0 commit comments

Comments
 (0)