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()],
|
month: (item, groupBy) => months[new Date(item[groupBy]).getMonth()],
|
||||||
week: (item, groupBy) => getWeekGroupFromTimestamp(item[groupBy]),
|
week: (item, groupBy) => getWeekGroupFromTimestamp(item[groupBy]),
|
||||||
year: (item, groupBy) => new Date(item[groupBy]).getFullYear().toString(),
|
year: (item, groupBy) => new Date(item[groupBy]).getFullYear().toString(),
|
||||||
default: (item, groupBy) =>
|
default: (item, groupBy) => {
|
||||||
item[groupBy] >= TIMESTAMPS.recent()
|
if (groupBy === "title") groupBy = "dateEdited";
|
||||||
|
return item[groupBy] >= TIMESTAMPS.recent()
|
||||||
? "Recent"
|
? "Recent"
|
||||||
: item[groupBy] >= TIMESTAMPS.lastWeek()
|
: item[groupBy] >= TIMESTAMPS.lastWeek()
|
||||||
? "Last week"
|
? "Last week"
|
||||||
: "Older",
|
: "Older";
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user