fix WI sorting error

c9acea8522b62e4d45775f9b05f6da4076f5d477

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +3 -3Showing whitespace changes
public/scripts/world-info.js+3 -3
@@ -1648,9 +1648,9 @@ function getWIElement(name) {
1648 */1648 */
1649export function sortWorldInfoEntries(data, { customSort = null } = {}) {1649export function sortWorldInfoEntries(data, { customSort = null } = {}) {
1650 const option = $('#world_info_sort_order').find(':selected');1650 const option = $('#world_info_sort_order').find(':selected');
1651 const sortField = customSort.sortField ?? option.data('field');1651 const sortField = customSort?.sortField ?? option.data('field');
1652 const sortOrder = customSort.sortOrder ?? option.data('order');1652 const sortOrder = customSort?.sortOrder ?? option.data('order');
1653 const sortRule = customSort.sortRule ?? option.data('rule');1653 const sortRule = customSort?.sortRule ?? option.data('rule');
1654 const orderSign = sortOrder === 'asc' ? 1 : -1;1654 const orderSign = sortOrder === 'asc' ? 1 : -1;
16551655
1656 if (!data.length) return data;1656 if (!data.length) return data;