Fix undeletion version, don't undelete twice

This commit is contained in:
Bryan Housel
2015-03-03 20:51:33 -05:00
parent e7f5691e9b
commit edda24360a
2 changed files with 6 additions and 4 deletions

View File

@@ -95,7 +95,7 @@ iD.actions.MergeRemoteChanges = function(id, localGraph, remoteGraph, formatUser
} else if (localNode && option === 'force_local') {
targetNode = iD.Entity(localNode,
{ version: (remoteNode ? remoteNode.version : localNode.version + 1) });
{ version: (remoteNode ? remoteNode.version : +localNode.version + 1) });
updates.replacements.push(targetNode);
} else if (localNode && remoteNode && option === 'safe') {
@@ -200,7 +200,7 @@ iD.actions.MergeRemoteChanges = function(id, localGraph, remoteGraph, formatUser
return iD.actions.DeleteMultiple([id])(graph);
} else if (option === 'force_local') {
target = iD.Entity(local, { version: local.version + 1 });
target = iD.Entity(local, { version: +local.version + 1 });
if (target.type === 'way') {
target = mergeChildren(target, _.uniq(local.nodes), updates, graph);
graph = updateChildren(updates, graph);

View File

@@ -35,8 +35,10 @@ iD.modes.Save = function(context) {
if (err) {
if (err.status === 410) { // Status: Gone (contains no responseText)
remoteGraph.remove(remoteGraph.hasEntity(id));
addDeleteConflict(id);
if (!tryAgain) {
remoteGraph.remove(remoteGraph.hasEntity(id));
addDeleteConflict(id);
}
} else {
errors.push({
id: id,