Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: make click on the sort by data modified show the most recent files first

Ilian Sapundshievd59b4ed98e99
diff --git a/src/renderer/perspectives/grid/components/MainContainer.tsx b/src/renderer/perspectives/grid/components/MainContainer.tsx
index 2a3b40914..40fc4a76a 100644
--- a/src/renderer/perspectives/grid/components/MainContainer.tsx
+++ b/src/renderer/perspectives/grid/components/MainContainer.tsx
@@ -120,6 +120,10 @@ function GridPerspective(props: Props) {
const handleSortBy = (handleSort) => {
if (sortBy !== handleSort) {
setSortBy(handleSort);
+ // Date-based sort defaults to descending (newest first) on first selection
+ if (handleSort === 'byDateModified') {
+ setOrderBy(false);
+ }
} else {
setOrderBy(!orderBy);
}