From 6765451cc82a9f31e6d9309d8a71c4caecaa07a9 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 19 May 2017 10:36:31 -0700 Subject: [PATCH] Ensure snapshots without story_ids get uploaded --- scripts/system/html/js/SnapshotReview.js | 2 +- scripts/system/snapshot.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/system/html/js/SnapshotReview.js b/scripts/system/html/js/SnapshotReview.js index d52ff3d4a6..6c5829d64f 100644 --- a/scripts/system/html/js/SnapshotReview.js +++ b/scripts/system/html/js/SnapshotReview.js @@ -300,7 +300,7 @@ function addImage(image_data, isLoggedIn, canShare, isGifLoading, isShowingPrevi if (!isGifLoading) { appendShareBar(id, isLoggedIn, canShare, isGif, blastButtonDisabled, hifiButtonDisabled, canBlast); } - if (!isGifLoading && !isShowingPreviousImages) { + if (!isGifLoading || (isShowingPreviousImages && !image_data.story_id)) { shareForUrl(id); } if (isShowingPreviousImages && isLoggedIn && image_data.story_id) { diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index 8b5ae3c9a7..4c661482fc 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -138,10 +138,10 @@ function onMessage(message) { isLoggedIn = Account.isLoggedIn(); if (isLoggedIn) { print('Sharing snapshot with audience "for_url":', message.data); - Window.shareSnapshot(message.data, message.href || href); + Window.shareSnapshot(message.data, Settings.getValue("previousSnapshotHref")); } else { shareAfterLogin = true; - snapshotToShareAfterLogin.push({ path: message.data, href: message.href || href }); + snapshotToShareAfterLogin.push({ path: message.data, href: Settings.getValue("previousSnapshotHref") }); } } }); @@ -349,6 +349,7 @@ function takeSnapshot() { // We will record snapshots based on the starting location. That could change, e.g., when recording a .gif. // Even the domainId could change (e.g., if the user falls into a teleporter while recording). href = location.href; + Settings.setValue("previousSnapshotHref", href); domainId = location.domainId; Settings.setValue("previousSnapshotDomainID", domainId);