mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix: do not allow sort by title when groupBy === default
This commit is contained in:
@@ -28,12 +28,14 @@ const KEY_SELECTORS = {
|
||||
month: (item, groupBy) => months[new Date(item[groupBy]).getMonth()],
|
||||
week: (item, groupBy) => getWeekGroupFromTimestamp(item[groupBy]),
|
||||
year: (item, groupBy) => new Date(item[groupBy]).getFullYear().toString(),
|
||||
default: (item, groupBy) =>
|
||||
item[groupBy] >= TIMESTAMPS.recent()
|
||||
default: (item, groupBy) => {
|
||||
if (groupBy === "title") groupBy = "dateEdited";
|
||||
return item[groupBy] >= TIMESTAMPS.recent()
|
||||
? "Recent"
|
||||
: item[groupBy] >= TIMESTAMPS.lastWeek()
|
||||
? "Last week"
|
||||
: "Older",
|
||||
: "Older";
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user