1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-02-01 19:15:01 +02:00

Desktop: Fixes #10283: Display correct sorting icon

This commit is contained in:
Laurent Cozic 2024-04-27 10:38:00 +01:00
parent 5b3f05f939
commit 5268b5bf6b

View File

@ -187,6 +187,8 @@ function NoteListControls(props: Props) {
}
function sortOrderFieldIcon() {
const defaultIcon = 'fas fa-cog';
const field = props.sortOrderField;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
const iconMap: any = {
@ -194,8 +196,10 @@ function NoteListControls(props: Props) {
user_created_time: 'far fa-calendar-plus',
title: 'fas fa-font',
order: 'fas fa-wrench',
todo_due: 'fas fa-calendar-check',
todo_completed: 'fas fa-check',
};
return `${iconMap[field] || iconMap['title']} ${field}`;
return `${iconMap[field] || defaultIcon} ${field}`;
}
function sortOrderReverseIcon() {