Check if user widget.

pull/21833/head
Richard Lewis 2018-03-13 10:07:27 +00:00
parent b2d23b6999
commit a81269cba8
1 changed files with 10 additions and 8 deletions

View File

@ -628,12 +628,14 @@ const onMessage = function(event) {
// Get and set user widgets (not associated with a specific room) // Get and set user widgets (not associated with a specific room)
// If roomId is specified, it must be validated, so room-based widgets agreed // If roomId is specified, it must be validated, so room-based widgets agreed
// handled further down. // handled further down.
if (event.data.action === "get_widgets") { if (event.data.userWidget) {
getWidgets(event, null); if (event.data.action === "get_widgets") {
return; getWidgets(event, null);
} else if (event.data.action === "set_widget") { return;
setWidget(event, null); } else if (event.data.action === "set_widget") {
return; setWidget(event, null);
return;
}
} }
if (!roomId) { if (!roomId) {
@ -661,10 +663,10 @@ const onMessage = function(event) {
// Get and set room-based widgets // Get and set room-based widgets
if (event.data.action === "get_widgets") { if (event.data.action === "get_widgets") {
getWidgets(event, null); getWidgets(event, roomId);
return; return;
} else if (event.data.action === "set_widget") { } else if (event.data.action === "set_widget") {
setWidget(event, null); setWidget(event, roomId);
return; return;
} }