aboutsummaryrefslogtreecommitdiff
path: root/src/App.vue
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-10-19 19:26:52 +1100
committerTerry Truong <terry06890@gmail.com>2022-10-19 19:34:38 +1100
commit2f5a989bf4ca944888cc16d06339fec237f60319 (patch)
tree80e6d2612f8e31ac36cb0989a0a00ddfbbf5d680 /src/App.vue
parent57d5c70198e711e28ff632d44b7bbb57e826f4fc (diff)
Move event labels to below images
Add client-side REQ_EXCLS_LIMIT Rename posX and posY vars in idToPos computed
Diffstat (limited to 'src/App.vue')
-rw-r--r--src/App.vue8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/App.vue b/src/App.vue
index 442d3cb..e836fbf 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -84,7 +84,7 @@ function onTimelineChg(state: TimelineState, idx: number){
}
// For timeline addition/removal
-const MIN_TIMELINE_BREADTH = 80 + 10 * 2 + 115; // TODO: Link with constants in components/TimeLine.vue
+const MIN_TIMELINE_BREADTH = 80 + 10 * 2 + 120; // TODO: Link with constants in components/TimeLine.vue
function onTimelineAdd(){
if (vert.value && contentWidth.value / (timelines.value.length + 1) < MIN_TIMELINE_BREADTH ||
!vert.value && contentHeight.value / (timelines.value.length + 1) < MIN_TIMELINE_BREADTH){
@@ -192,6 +192,7 @@ function reduceEvents(){
}
// For getting events from server
const EVENT_REQ_LIMIT = 30;
+const REQ_EXCLS_LIMIT = 100;
let pendingReq = false; // Used to serialise event-req handling
async function onEventReq(startDate: HistDate, endDate: HistDate){
while (pendingReq){
@@ -214,6 +215,11 @@ async function onEventReq(startDate: HistDate, endDate: HistDate){
}
existingEventIds.push(event.id);
}
+ if (existingEventIds.length > REQ_EXCLS_LIMIT){
+ console.log('WARNING: Exceeded request exclusions limit');
+ pendingReq = false;
+ return;
+ }
// Get events from server
let urlParams = new URLSearchParams({
type: 'events',