Hack to fix sorting after reordering columns

There's probably a better fix for this, but this seems to work.
This commit is contained in:
Dan Stillman 2021-08-31 06:54:41 -04:00
parent 4fa7070a31
commit 69a43ec456

View file

@ -3265,6 +3265,9 @@ var ItemTree = class ItemTree extends LibraryTree {
_handleColumnSort = async (index, sortDirection) => {
let columnSettings = this._getColumnPrefs();
// TEMP: Sort the columns by their ordinals, which can get out of sync after column
// dragging. There's probably a better way to do this.
this._getColumns().sort((a, b) => a.ordinal - b.ordinal);
let column = this._getColumn(index);
if (column.dataKey == 'hasAttachment') {
Zotero.debug("Caching best attachment states");