Fix playerList displayName sorting

This commit is contained in:
Natsumi
2025-11-22 02:45:49 +11:00
parent 2cd9fc20c8
commit e2f41b09d6

View File

@@ -327,7 +327,8 @@
:label="t('table.playerList.displayName')"
min-width="140"
prop="displayName"
:sortable="true">
sortable
:sort-method="(a, b) => sortAlphabetically(a, b, 'displayName')">
<template #default="scope">
<span
v-if="randomUserColours"
@@ -509,4 +510,9 @@
};
return getValue(b) - getValue(a);
}
function sortAlphabetically(a, b, field) {
if (!a[field] || !b[field]) return 0;
return a[field].toLowerCase().localeCompare(b[field].toLowerCase());
}
</script>