diff --git a/app/controllers/experiments_controller.rb b/app/controllers/experiments_controller.rb index 13eb02177..f9dd87ec1 100644 --- a/app/controllers/experiments_controller.rb +++ b/app/controllers/experiments_controller.rb @@ -92,6 +92,15 @@ class ExperimentsController < ApplicationController @project = @experiment.project @experiment.current_view_state(current_user) @my_module_visible_table_columns = current_user.my_module_visible_table_columns + + view_state = @experiment.current_view_state(current_user) + @current_sort = view_state.state.dig('my_modules', my_modules_view_mode(@project), 'sort') || 'atoz' + end + + def my_modules_view_mode(my_module) + return 'archived' if my_module.archived? + + params[:view_mode] == 'archived' ? 'archived' : 'active' end def load_table diff --git a/app/views/experiments/_table_display_modal.html.erb b/app/views/experiments/_table_display_modal.html.erb index ebf4d6885..1545ec6ee 100644 --- a/app/views/experiments/_table_display_modal.html.erb +++ b/app/views/experiments/_table_display_modal.html.erb @@ -12,7 +12,7 @@ <% Experiments::TableViewService::COLUMNS.each do |col| %>
<% if col == :archived && params[:view_mode] != 'archived' %> - + <% elsif col != :task_name %> <% end %>