no uppercase remote avatar search

This commit is contained in:
Natsumi
2025-05-23 18:02:04 +10:00
parent 523c5052b4
commit 84a985f42d
+5 -4
View File
@@ -581,7 +581,8 @@
searchAvatarSort.value = 'name'; searchAvatarSort.value = 'name';
} }
const avatars = new Map(); const avatars = new Map();
const query = props.searchText.toUpperCase(); const query = props.searchText;
const queryUpper = query.toUpperCase();
if (!query) { if (!query) {
for (ref of API.cachedAvatars.values()) { for (ref of API.cachedAvatars.values()) {
switch (searchAvatarFilter.value) { switch (searchAvatarFilter.value) {
@@ -604,12 +605,12 @@
} else { } else {
if (searchAvatarFilterRemote.value === 'all' || searchAvatarFilterRemote.value === 'local') { if (searchAvatarFilterRemote.value === 'all' || searchAvatarFilterRemote.value === 'local') {
for (ref of API.cachedAvatars.values()) { for (ref of API.cachedAvatars.values()) {
let match = ref.name.toUpperCase().includes(query); let match = ref.name.toUpperCase().includes(queryUpper);
if (!match && ref.description) { if (!match && ref.description) {
match = ref.description.toUpperCase().includes(query); match = ref.description.toUpperCase().includes(queryUpper);
} }
if (!match && ref.authorName) { if (!match && ref.authorName) {
match = ref.authorName.toUpperCase().includes(query); match = ref.authorName.toUpperCase().includes(queryUpper);
} }
if (match) { if (match) {
switch (searchAvatarFilter.value) { switch (searchAvatarFilter.value) {