diff --git a/app/assets/javascripts/my_modules/status_flow.js b/app/assets/javascripts/my_modules/status_flow.js index d9419a85e..7956e4367 100644 --- a/app/assets/javascripts/my_modules/status_flow.js +++ b/app/assets/javascripts/my_modules/status_flow.js @@ -1,4 +1,4 @@ -/* global animateSpinner GLOBAL_CONSTANTS */ +/* global animateSpinner */ (function() { $('.task-sharing-and-flows').on('click', '#viewTaskFlow', function() { @@ -19,7 +19,7 @@ if (statusData.status_changing) { setTimeout(() => { checkStatusState(); }, GLOBAL_CONSTANTS.FAST_STATUS_POLLING_INTERVAL); } else { - $('.task-sharing-and-flows .status-flow-container').replaceWith(statusData.html); + location.reload(); } }); } @@ -45,9 +45,6 @@ success: function(result) { animateSpinner(null, false); $('.task-sharing-and-flows .status-flow-container').replaceWith(result.html); - if (result.status_changing) { - setTimeout(() => { checkStatusState(); }, GLOBAL_CONSTANTS.FAST_STATUS_POLLING_INTERVAL); - } }, error: function(e) { animateSpinner(null, false); diff --git a/app/controllers/my_modules_controller.rb b/app/controllers/my_modules_controller.rb index 52a900771..b594a1fb8 100644 --- a/app/controllers/my_modules_controller.rb +++ b/app/controllers/my_modules_controller.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class MyModulesController < ApplicationController include TeamsHelper include ActionView::Helpers::TextHelper @@ -123,16 +121,8 @@ class MyModulesController < ApplicationController if @my_module.last_transition_error && @my_module.last_transition_error['type'] == 'repository_snapshot' flash[:repository_snapshot_error] = @my_module.last_transition_error end - response = { status_changing: @my_module.status_changing? } - unless @my_module.status_changing? - response[:html] = render_to_string( - partial: 'my_modules/status_flow/task_flow_button', - locals: { my_module: @my_module }, - formats: :html - ) - end - render json: response + render json: { status_changing: @my_module.status_changing? } end def canvas_dropdown_menu @@ -389,7 +379,6 @@ class MyModulesController < ApplicationController render json: { status: :changed, - status_changing: @my_module.status_changing?, html: render_to_string( partial: 'my_modules/status_flow/task_flow_button', locals: { my_module: @my_module },