From c7e965fc3dc6ffe01e6d4823d56f7b604fef6270 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Tue, 18 Oct 2022 19:44:04 +1100
Subject: Reduce event data after reaching a memory limit

---
 src/components/TimeLine.vue | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/components/TimeLine.vue')

diff --git a/src/components/TimeLine.vue b/src/components/TimeLine.vue
index 6c6b6fc..577413d 100644
--- a/src/components/TimeLine.vue
+++ b/src/components/TimeLine.vue
@@ -67,7 +67,7 @@ const props = defineProps({
 	initialState: {type: Object as PropType<TimelineState>, required: true},
 	eventTree: {type: Object as PropType<RBTree<HistEvent>>, required: true},
 });
-const emit = defineEmits(['remove', 'state-chg', 'event-req']);
+const emit = defineEmits(['remove', 'state-chg', 'event-req', 'event-display']);
 
 // For size tracking
 const width = ref(0);
@@ -285,6 +285,8 @@ const idToPos = computed(() => {
 	// If more events could be displayed, notify parent
 	if (map.size < 3 && !pendingReq){
 		emit('event-req', startDate.value, endDate.value);
+	} else { // Send displayed event IDs to parent
+		emit('event-display', [...idToEvent.value.keys()], ID);
 	}
 	pendingReq = true;
 	//
-- 
cgit v1.2.3

