Fix MS18609: Various Snapshot sharing bugs

This commit is contained in:
Zach Fox 2018-10-01 12:09:49 -07:00
parent cd18578061
commit 58f098577d

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:
@ -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;