From 281899055de50b28824a75d96485abf3c02c4e82 Mon Sep 17 00:00:00 2001
From: Jeff Carr <jcarr@wit.com>
Date: Sun, 23 Feb 2025 05:23:21 -0600
Subject: [PATCH] check if the table is already here

---
 structs.go |  1 +
 table.go   | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/structs.go b/structs.go
index d012f73..7919856 100644
--- a/structs.go
+++ b/structs.go
@@ -37,6 +37,7 @@ type TreeInfo struct {
 	ShowTable    func(*guipb.Table)  // attempt at sending a whole table
 	// NodeI             interface{} // is an interface useful here?
 	// NodeAction   func(*Node, widget.ActionType) // deprecate
+	currentTables []*guipb.Table
 }
 
 type Node struct {
diff --git a/table.go b/table.go
index 57d7e44..24347cd 100644
--- a/table.go
+++ b/table.go
@@ -42,6 +42,17 @@ func (me *TreeInfo) doTable(a widget.Action) {
 		// }
 		// dumpTable(t)
 		// me.ShowTable(t)
+		log.Info("TREE FOUND TABLE UUID", t.Uuid)
+		for i, ot := range me.currentTables {
+			log.Info("TREE already has UUID", i, ot.Uuid)
+			if t.Uuid == ot.Uuid {
+				log.Info("TREE found UUID! update table here", i, ot.Uuid)
+				log.Info("todo: compare table here...")
+				return
+			}
+		}
+
+		me.currentTables = append(me.currentTables, t)
 		me.makeTable(t)
 	}
 }