From 51f45364241e3a0733d9e94ace0cff7f699ada66 Mon Sep 17 00:00:00 2001 From: jerl Date: Fri, 26 Apr 2024 18:46:00 -0700 Subject: [PATCH] fix space bug --- client/index.html | 1 + client/space.js | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/client/index.html b/client/index.html index 4977816..7aa67e5 100644 --- a/client/index.html +++ b/client/index.html @@ -172,6 +172,7 @@ } .span { position: absolute; + white-space: nowrap; } diff --git a/client/space.js b/client/space.js index ecd06fb..c9b694b 100644 --- a/client/space.js +++ b/client/space.js @@ -17,7 +17,15 @@ function mousemove(event) { save(dragging); } +let saving; +let queue; + function save(span) { + if (saving) { + queue = span; + return; + } + saving = true; window.emit('save_span', { thread: spaceId, id: span.id ? span.id.slice(4) : '', @@ -30,6 +38,11 @@ function save(span) { console.log('span save failed: ' + msg.message); if (!span.id) span.id = 'span' + msg.id; + saving = false; + if (queue) { + save(queue); + queue = null; + } }); }