From 041a7f7bbfe23b44bbf0d203e01a2b308161b7bf Mon Sep 17 00:00:00 2001 From: sylenien Date: Wed, 5 Oct 2022 11:19:29 +0200 Subject: [PATCH] change(tracker): update for better readability --- .../MessageDistributor/MessageDistributor.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/app/player/MessageDistributor/MessageDistributor.ts b/frontend/app/player/MessageDistributor/MessageDistributor.ts index b342fd4bf..488afa53b 100644 --- a/frontend/app/player/MessageDistributor/MessageDistributor.ts +++ b/frontend/app/player/MessageDistributor/MessageDistributor.ts @@ -69,7 +69,15 @@ import type { MouseClick, } from './messages'; -import type { Timed } from './messages/timed'; +const visualChanges = [ + "mouse_move", + "mouse_click", + "create_element_node", + "set_input_value", + "set_input_checked", + "set_viewport_size", + "set_viewport_scroll", +] export default class MessageDistributor extends StatedScreen { // TODO: consistent with the other data-lists @@ -391,15 +399,7 @@ export default class MessageDistributor extends StatedScreen { distributeMessage(msg: Message, index: number): void { const lastMessageTime = Math.max(msg.time, this.lastMessageTime) this.lastMessageTime = lastMessageTime - if ([ - "mouse_move", - "mouse_click", - "create_element_node", // not a user activity, though visual change - "set_input_value", - "set_input_checked", - "set_viewport_size", - "set_viewport_scroll", - ].includes(msg.tp)) { + if (visualChanges.includes(msg.tp)) { this.activityManager?.updateAcctivity(msg.time); } //const index = i + index; //?