mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
[MIRROR] [TGUI 5.0 Prep] Removes context (#7455)
Co-authored-by: Selis <sirlionfur@hotmail.de> Co-authored-by: Selis <selis@xynolabs.com>
This commit is contained in:
@@ -11,12 +11,10 @@ const logger = createLogger('telemetry');
|
||||
|
||||
const MAX_CONNECTIONS_STORED = 10;
|
||||
|
||||
// prettier-ignore
|
||||
const connectionsMatch = (a, b) => (
|
||||
a.ckey === b.ckey
|
||||
&& a.address === b.address
|
||||
&& a.computer_id === b.computer_id
|
||||
);
|
||||
const connectionsMatch = (a, b) =>
|
||||
a.ckey === b.ckey &&
|
||||
a.address === b.address &&
|
||||
a.computer_id === b.computer_id;
|
||||
|
||||
export const telemetryMiddleware = (store) => {
|
||||
let telemetry;
|
||||
@@ -58,9 +56,10 @@ export const telemetryMiddleware = (store) => {
|
||||
}
|
||||
// Append a connection record
|
||||
let telemetryMutated = false;
|
||||
// prettier-ignore
|
||||
const duplicateConnection = telemetry.connections
|
||||
.find(conn => connectionsMatch(conn, client));
|
||||
|
||||
const duplicateConnection = telemetry.connections.find((conn) =>
|
||||
connectionsMatch(conn, client)
|
||||
);
|
||||
if (!duplicateConnection) {
|
||||
telemetryMutated = true;
|
||||
telemetry.connections.unshift(client);
|
||||
|
||||
Reference in New Issue
Block a user