Passing path to resolve function to fix race condition with global path variable

pull/117/merge
Tim Robinson 2015-06-08 14:58:45 +00:00
rodzic 90baf8a727
commit ab84c52a13
1 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -186,7 +186,7 @@ define(function(require, exports, module) {
return;
}
function resolve() {
function resolve(path) {
console.log("[watchers] resolved change event without dialog", path);
doc.tab.classList.remove("conflict");
delete doc.meta.$merge;
@ -340,12 +340,12 @@ define(function(require, exports, module) {
var doc = tab.document;
doc.setBookmarkedValue(data, true);
doc.meta.timestamp = Date.now() - settings.timeOffset;
changedPaths[path].resolve();
changedPaths[path].resolve(path);
}
function mergeChangedPath(err, path, data) {
merge(changedPaths[path].tab, data);
changedPaths[path].resolve();
changedPaths[path].resolve(path);
}
function showChangeDialog(tab, data) {
@ -368,12 +368,12 @@ define(function(require, exports, module) {
if (all) {
for (var id in changedPaths) {
changedPaths[id].tab.document.undoManager.bookmark(-2);
changedPaths[id].resolve();
changedPaths[id].resolve(path);
}
}
else {
changedPaths[path].tab.document.undoManager.bookmark(-2);
changedPaths[path].resolve();
changedPaths[path].resolve(path);
}
checkEmptyQueue();
}