Friends list sort language and search rank

This commit is contained in:
Natsumi
2021-04-06 09:43:56 +12:00
parent 14283bc3aa
commit 8c6d811994
2 changed files with 22 additions and 3 deletions

View File

@@ -9877,7 +9877,7 @@ speechSynthesis.getVoices();
$app.data.friendsListSearch = '';
$app.data.friendsListSearchFilterVIP = false;
$app.data.friendsListSearchFilters = [ 'User Name', 'Display Name', 'Status', 'Bio', 'Memo' ];
$app.data.friendsListSearchFilters = [ 'Display Name', 'User Name', 'Rank', 'Status', 'Bio', 'Memo' ];
$app.methods.friendsListSearchChange = function () {
var filters = this.friendsListSearchFilters;
@@ -9921,6 +9921,11 @@ speechSynthesis.getVoices();
ctx.ref.statusDescription) {
match = String(ctx.ref.statusDescription).toUpperCase().includes(query);
}
if (!match &&
filters.includes('Rank') &&
ctx.ref.$friendNum) {
match = String(ctx.ref.$trustLevel).toUpperCase().includes(query);
}
if (!match) {
continue;
}
@@ -9994,6 +9999,20 @@ speechSynthesis.getVoices();
return a[field].toLowerCase().localeCompare(b[field].toLowerCase());
};
$app.methods.sortLanguages = function (a, b) {
var sortedA = [];
var sortedB = [];
a.$languages.forEach((item) => {
sortedA.push(item.value);
});
b.$languages.forEach((item) => {
sortedB.push(item.value);
});
sortedA.sort();
sortedB.sort();
return JSON.stringify(sortedA).localeCompare(JSON.stringify(sortedB));
};
$app.methods.genMd5 = async function (file) {
var response = await AppApi.MD5File(file);
return response;