Explorar o código

Don't try to open deleted docs for editing

James Allen %!s(int64=12) %!d(string=hai) anos
pai
achega
54ecab854d

+ 7 - 1
services/web/public/coffee/track-changes/TrackChangesManager.coffee

@@ -94,7 +94,13 @@ define [
 			@ide.editor.enable()
 			@ide.fileViewManager.enable()
 			@disable()
-			@ide.fileTreeManager.openDoc(@doc_id)
+
+			doc = @ide.fileTreeManager.getEntity(@doc_id, include_deleted: true)
+			if doc? and doc.get("deleted")
+				@ide.fileTreeManager.openDoc(@ide.project.get("rootDoc_id"))
+			else
+				@ide.fileTreeManager.openDoc(@doc_id)
+
 			@ide.tabManager.show "code"
 			@resetLabels()
 			@ide.fileTreeManager.makeReadWriteIfAllowed()