Fixed blank remote desktop on connect.

This commit is contained in:
Ylian Saint-Hilaire 2020-11-06 16:33:54 -08:00
parent 326dbb0b19
commit e7c38ca5fd
3 changed files with 4 additions and 3 deletions

View File

@ -4479,7 +4479,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if ((user.siteadmin != 0xFFFFFFFF) && ((user.siteadmin & 1024) != 0)) return; // If this account is settings locked, return here.
if (common.validateString(command.state, 1, 10000) == false) break; // Check state size, no more than 10k
command.state = parent.filterUserWebState(command.state); // Filter the state to remove anything bad
if ((command.state == null) || (typeof command.state !== 'string')) { console.log('tt'); break; } // If state did not validate correctly, quit here.
if ((command.state == null) || (typeof command.state !== 'string')) break; // If state did not validate correctly, quit here.
db.Set({ _id: 'ws' + user._id, state: command.state });
parent.parent.DispatchEvent([user._id], obj, { action: 'userWebState', nolog: 1, domain: domain.id, state: command.state });
break;

File diff suppressed because one or more lines are too long

View File

@ -47,7 +47,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
obj.FirstDraw = false;
obj.ScreenWidth = 960;
obj.ScreenHeight = 700;
obj.ScreenHeight = 701;
obj.width = 960;
obj.height = 960;
@ -182,6 +182,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
obj.ProcessScreenMsg = function (width, height) {
if (obj.debugmode > 0) { console.log("ScreenSize: " + width + " x " + height); }
if ((obj.ScreenWidth == width) || (obj.ScreenHeight == height)) return; // Ignore change if screen is same size.
obj.Canvas.setTransform(1, 0, 0, 1, 0, 0);
obj.rotation = 0;
obj.FirstDraw = true;