Merge pull request #14120 from zfox23/MS18609_snapShareBugs

Fix MS18609: Various Snapshot sharing bugs
This commit is contained in:
John Conklin II 2018-10-18 18:21:23 -07:00 committed by GitHub
commit bbccd0ff73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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:
@ -333,11 +337,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 = [];
@ -369,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;