diff --git a/scripts/system/html/ShareSnapshot.html b/scripts/system/html/ShareSnapshot.html index d838a01e99..d41da0fb7a 100644 --- a/scripts/system/html/ShareSnapshot.html +++ b/scripts/system/html/ShareSnapshot.html @@ -28,10 +28,16 @@ paths.push(data); } - function handleShareButtons(canShare) { - if (!canShare) { - // hide the share/do not share buttons - document.getElementById("sharing").innerHTML = "
You can share if you are logged in and in a public place"; + function handleShareButtons(shareMsg) { + if (!shareMsg.canShare) { + // this means you may or may not be logged in, but can't share + // because you are not in a public place. + document.getElementById("sharing").innerHTML = "
You can share if you are in a public place"; + } else if (!shareMsg.isLoggedIn) { + // this means you are in a public place, but can't share because + // you need to login. Soon we will just bring up the share dialog + // in this case (and maybe set a boolean here to inform the html) + document.getElementById("sharing").innerHTML = "
You can share if you are logged in"; } } window.onload = function () { @@ -41,9 +47,8 @@ // Set up a handler for receiving the data, and tell the .js we are ready to receive it. EventBridge.scriptEventReceived.connect(function (message) { // last element of list contains a bool for whether or not we can share stuff - var canShare = message.pop().canShare; - print("canShare:"+canShare+", message:" + message.toString()) - handleShareButtons(canShare); + var shareMsg = message.pop(); + handleShareButtons(shareMsg); // rest are image paths which we add message.forEach(addImage); @@ -74,10 +79,10 @@