From af0d72df00fecf643f6d8a091f5b7cc344e607b5 Mon Sep 17 00:00:00 2001
From: Michael Sippel <micha@fragmental.art>
Date: Mon, 2 Sep 2024 00:11:12 +0200
Subject: [PATCH] vec buffer: send ListDiff::Clear before refilling vec with
 new values in with_data_arc_port()

---
 src/buffer/vec.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/buffer/vec.rs b/src/buffer/vec.rs
index 2afdb97..76dc062 100644
--- a/src/buffer/vec.rs
+++ b/src/buffer/vec.rs
@@ -86,6 +86,7 @@ where
     pub fn with_data_arc_port(data: Arc<RwLock<Vec<T>>>, port: InnerViewPort<RwLock<Vec<T>>>) -> Self {
         port.set_view(Some(data.clone()));
 
+        port.notify(&VecDiff::Clear);
         for x in data.read().unwrap().iter().cloned() {
             port.notify(&VecDiff::Push(x));
         }