mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-08 14:15:35 +08:00
Fix a bug with table order not updating properly with col deletion
This commit is contained in:
parent
9e106acf73
commit
63b7b937bb
1 changed files with 6 additions and 1 deletions
|
@ -54,7 +54,12 @@ class RepositoryTableStateColumnUpdateService
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
state['order'].reject! { |k, v| v[0] == old_column_index }
|
state['order'].reject! { |_, v| v[0] == old_column_index }
|
||||||
|
state['order'].each do |k, v|
|
||||||
|
if v[0].to_i > old_column_index.to_i
|
||||||
|
state['order'][k] = [(v[0].to_i - 1).to_s, v[1]]
|
||||||
|
end
|
||||||
|
end
|
||||||
if state['order'].empty?
|
if state['order'].empty?
|
||||||
# Fallback to default order if user had table ordered by
|
# Fallback to default order if user had table ordered by
|
||||||
# the deleted column
|
# the deleted column
|
||||||
|
|
Loading…
Add table
Reference in a new issue