[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:
CHOMPStation2
2024-02-07 15:37:37 -07:00
committed by GitHub
parent 8e448db4a1
commit c96b18a2d3
308 changed files with 1861 additions and 2440 deletions

View File

@@ -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);