summaryrefslogtreecommitdiff
path: root/ui/lib/runs.js
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2025-05-08 19:40:11 -0400
committerOwen Jacobson <owen@grimoire.ca>2025-05-08 19:40:11 -0400
commit92266a13bfabf7b29f08bc85d0e8efba467167da (patch)
treef286c25c5b5f798a6eaeba1e9a1dd5e6306530a5 /ui/lib/runs.js
parentb80b0620f7f730576a09005be0a15919925a5582 (diff)
Rather than exploding a user into properties inside `runs`, use a helper method.
Diffstat (limited to 'ui/lib/runs.js')
-rw-r--r--ui/lib/runs.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/ui/lib/runs.js b/ui/lib/runs.js
index e3d4c20..de00e6a 100644
--- a/ui/lib/runs.js
+++ b/ui/lib/runs.js
@@ -1,4 +1,5 @@
import * as iter from './iterator.js';
+import { User } from './state/remote/users.svelte.js';
const RUN_COALESCE_MAX_INTERVAL = 10 /* min */ * 60 /* sec */ * 1000; /* ms */
@@ -21,13 +22,5 @@ function runKey(message) {
}
function continueRun([lastSender, lastAt], [newSender, newAt]) {
- const { id: lastId, name: lastName } = lastSender;
- const { id: newId, name: newName } = newSender;
- if (lastId !== newId) {
- return false;
- }
- if (lastName !== newName) {
- return false;
- }
- return newAt - lastAt < RUN_COALESCE_MAX_INTERVAL;
+ return User.equal(lastSender, newSender) && newAt - lastAt < RUN_COALESCE_MAX_INTERVAL;
}