Skip to content

Commit

Permalink
Add unauthorized message event.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Apr 22, 2020
1 parent 20ad3bd commit 135ad17
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Server/Services/RCBrowserSocketHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ public async Task<Task> SendScreenCastRequestToDevice(string screenCasterID, str
{
return RCDeviceHub.Clients.Client(screenCasterID).SendAsync("GetScreenCast", Context.ConnectionId, requesterName);
}
else
{
return Clients.Caller.SendAsync("Unauthorized");
}
}
else
{
Expand Down
6 changes: 6 additions & 0 deletions Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ export class RCBrowserSockets {
UI.ShowMessage("Connection failed. Please reconnect.");
this.Connection.stop();
});
hubConnection.on("Unauthorized", () => {
UI.ConnectButton.removeAttribute("disabled");
UI.StatusMessage.innerHTML = "Authorization failed.";
UI.ShowMessage("Authorization failed.");
this.Connection.stop();
});
hubConnection.on("ViewerRemoved", () => {
UI.ConnectButton.removeAttribute("disabled");
UI.StatusMessage.innerHTML = "The session was stopped by your partner.";
Expand Down
1 change: 1 addition & 0 deletions Server/wwwroot/scripts/RemoteControl/UI.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Server/wwwroot/scripts/RemoteControl/UI.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Server/wwwroot/scripts/RemoteControl/UI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ export function UpdateCursor(imageBytes: Uint8Array, hotSpotX: number, hotSpotY:
var base64 = ConvertUInt8ArrayToBase64(imageBytes);
ScreenViewer.style.cursor = `url('data:image/png;base64,${base64}') ${hotSpotX} ${hotSpotY}, default`;
}
console.log("Cursor updated: " + ScreenViewer.style.cursor);
}

export function UpdateDisplays(selectedDisplay: string, displayNames: string[]) {
Expand Down

0 comments on commit 135ad17

Please sign in to comment.