From 702d5754fc3fef82e46b6fbb633f886ea3e60616 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Thu, 12 Dec 2019 09:33:21 -0800 Subject: [PATCH] Fix remote control input. --- Server/wwwroot/scripts/DataGrid.ts | 2 +- Server/wwwroot/scripts/RemoteControl/Main.ts | 3 +-- .../scripts/RemoteControl/RCBrowserSockets.ts | 14 ++++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Server/wwwroot/scripts/DataGrid.ts b/Server/wwwroot/scripts/DataGrid.ts index cc763d2d..29f2cc57 100644 --- a/Server/wwwroot/scripts/DataGrid.ts +++ b/Server/wwwroot/scripts/DataGrid.ts @@ -46,7 +46,7 @@ export function AddOrUpdateDevice(device: Device) { .replace("true", "") .replace("false", "")} ${device.DeviceName} - ${device.Alias} + ${device.Alias || ""} ${device.CurrentUser} ${new Date(device.LastOnline).toLocaleString()} ${device.Platform} diff --git a/Server/wwwroot/scripts/RemoteControl/Main.ts b/Server/wwwroot/scripts/RemoteControl/Main.ts index 32c90000..195873c4 100644 --- a/Server/wwwroot/scripts/RemoteControl/Main.ts +++ b/Server/wwwroot/scripts/RemoteControl/Main.ts @@ -5,7 +5,6 @@ import { RemoteControlMode } from "../Enums/RemoteControlMode.js"; var queryString = Utilities.ParseSearchString(); -var rcBrowserSockets = new RCBrowserSockets(); export const RemoteControl = { @@ -16,7 +15,7 @@ export const RemoteControl = { Mode: RemoteControlMode.None, Init: () => { - UI.ApplyInputHandlers(rcBrowserSockets); + UI.ApplyInputHandlers(RemoteControl.RCBrowserSockets); if (queryString["clientID"]) { RemoteControl.Mode = RemoteControlMode.Unattended; diff --git a/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts b/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts index d92c138e..4396022d 100644 --- a/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts +++ b/Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts @@ -6,13 +6,15 @@ import { Sound } from "../Sound.js"; var signalR = window["signalR"]; +type HubConnection = { + start: () => Promise; + closedCallbacks: any[]; + invoke: (...rest) => any; + stop: () => any; +} + export class RCBrowserSockets { - Connection = { - start: async () => { }, - closedCallbacks: [], - invoke: (...rest) => { }, - stop: () => { } - }; + Connection: HubConnection; Connect() { this.Connection = new signalR.HubConnectionBuilder()