Commit 6e4a2d1ee362fea13626ed07a8281c0994c2ec14

Authored by Rafael Manzo
Committed by Eduardo Silva Araújo
1 parent 70c9a846
Exists in colab

[Colab] Fixes processing state query for subdirectory on routes

app/views/repositories/reload_processing.js.erb
@@ -2,10 +2,13 @@ current_path_splited = window.location.pathname.split("/"); @@ -2,10 +2,13 @@ current_path_splited = window.location.pathname.split("/");
2 if(current_path_splited[1] != "repositories"){ 2 if(current_path_splited[1] != "repositories"){
3 current_path_splited.splice(1,1); // Removes the locale 3 current_path_splited.splice(1,1); // Removes the locale
4 } 4 }
  5 +if(current_path_splited[1] != "projects"){
  6 + current_path_splited.splice(1,1); // Removes the subdirectory
  7 +}
5 current_path = current_path_splited.join("/"); 8 current_path = current_path_splited.join("/");
6 9
7 // This if prevents it from updating the repository's state after the user leaves its page 10 // This if prevents it from updating the repository's state after the user leaves its page
8 -if(current_path == '<%= repository_path(id: @repository, locale: nil) %>'){ 11 +if(current_path == '<%= repository_path(id: @repository.id, locale: nil, subdirectory: nil) %>'){
9 $('div#processing_information').html('<%= escape_javascript(render partial: "processing_information") %>'); 12 $('div#processing_information').html('<%= escape_javascript(render partial: "processing_information") %>');
10 repository = new Repository.State(<%= @repository.id %>) 13 repository = new Repository.State(<%= @repository.id %>)
11 repository.schedule_poll_state('<%= @processing.state %>') 14 repository.schedule_poll_state('<%= @processing.state %>')