From 035ff0a1f0b0984560d9589f289db86fa66d8dce Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Fri, 10 Aug 2018 15:57:10 +0100 Subject: [PATCH] More bugfixing. --- .../public/coffee/ide/history/HistoryV2Manager.coffee | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/services/web/public/coffee/ide/history/HistoryV2Manager.coffee b/services/web/public/coffee/ide/history/HistoryV2Manager.coffee index e8a3f46f24..ddd098a5f5 100644 --- a/services/web/public/coffee/ide/history/HistoryV2Manager.coffee +++ b/services/web/public/coffee/ide/history/HistoryV2Manager.coffee @@ -238,9 +238,15 @@ define [ @ide.$filter("orderBy")(labels, [ '-version', '-created_at' ]) loadFileAtPointInTime: () -> - console.log @$scope.history.selection.pathname, @$scope.history.selection.updates pathname = @$scope.history.selection.pathname - toV = @$scope.history.selection.updates[0].toV + if @$scope.history.selection.updates?[0]? + toV = @$scope.history.selection.updates[0].toV + else + for label in @$scope.history.labels or [] + if label.selected + toV = label.version + if !toV? + return url = "/project/#{@$scope.project_id}/diff" query = ["pathname=#{encodeURIComponent(pathname)}", "from=#{toV}", "to=#{toV}"] url += "?" + query.join("&")