Skip to content

Commit b0096ab

Browse files
committed
fix: avoid duplicating selected color when restoring
1 parent 8f5df6c commit b0096ab

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/window.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,12 @@ impl AppWindow {
285285
self.history()
286286
// we need to clone here, as `extend` requires a mutable reference
287287
.clone()
288-
.extend(history.into_iter().map(|color| HistoryObject::new(color)));
288+
.extend(
289+
history
290+
.into_iter()
291+
.skip(1)
292+
.map(|color| HistoryObject::new(color)),
293+
);
289294

290295
tracing::debug!("Finished restoring");
291296
Some(())

0 commit comments

Comments
 (0)