From 58f098577d794268badd820ec382be471c8b678e Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 1 Oct 2018 12:09:49 -0700 Subject: [PATCH 1/2] Fix MS18609: Various Snapshot sharing bugs --- scripts/system/snapshot.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index 3d744b3bd2..67539ff366 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -44,7 +44,10 @@ try { } function removeFromStoryIDsToMaybeDelete(story_id) { - storyIDsToMaybeDelete.splice(storyIDsToMaybeDelete.indexOf(story_id), 1); + story_id = parseInt(story_id); + if (storyIDsToMaybeDelete.indexOf(story_id) > -1) { + storyIDsToMaybeDelete.splice(storyIDsToMaybeDelete.indexOf(story_id), 1); + } print('storyIDsToMaybeDelete[] now:', JSON.stringify(storyIDsToMaybeDelete)); } @@ -258,6 +261,7 @@ function onMessage(message) { } break; case 'removeFromStoryIDsToMaybeDelete': + console.log("Facebook OR Twitter button clicked for story_id " + message.story_id); removeFromStoryIDsToMaybeDelete(message.story_id); break; default: @@ -371,7 +375,8 @@ function snapshotUploaded(isError, reply) { isGif = fileExtensionMatches(imageURL, "gif"), ignoreGifSnapshotData = false, ignoreStillSnapshotData = false; - storyIDsToMaybeDelete.push(storyID); + storyIDsToMaybeDelete.push(parseInt(storyID)); + print('storyIDsToMaybeDelete[] now:', JSON.stringify(storyIDsToMaybeDelete)); if (isGif) { if (mostRecentGifSnapshotFilename !== replyJson.user_story.details.original_image_file_name) { ignoreGifSnapshotData = true; From 0081f9aac09bb88b417ddd0cd2414bdda8c4efc5 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 1 Oct 2018 12:24:47 -0700 Subject: [PATCH 2/2] Also fix MS18512 --- scripts/system/snapshot.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index 67539ff366..261c1471f2 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -339,11 +339,13 @@ function fillImageDataFromPrevious() { var previousAnimatedSnapStoryID = Settings.getValue("previousAnimatedSnapStoryID"); var previousAnimatedSnapBlastingDisabled = Settings.getValue("previousAnimatedSnapBlastingDisabled"); var previousAnimatedSnapHifiSharingDisabled = Settings.getValue("previousAnimatedSnapHifiSharingDisabled"); + snapshotOptions = { containsGif: previousAnimatedSnapPath !== "", processingGif: false, shouldUpload: false, - canBlast: snapshotDomainID === Settings.getValue("previousSnapshotDomainID"), + canBlast: snapshotDomainID === Settings.getValue("previousSnapshotDomainID") && + snapshotDomainID === location.domainID, isLoggedIn: isLoggedIn }; imageData = [];