tui: stabilize session dialog ordering (#22987)
This commit is contained in:
@@ -113,7 +113,11 @@ export function DialogSessionList() {
|
|||||||
const today = new Date().toDateString()
|
const today = new Date().toDateString()
|
||||||
return sessions()
|
return sessions()
|
||||||
.filter((x) => x.parentID === undefined)
|
.filter((x) => x.parentID === undefined)
|
||||||
.toSorted((a, b) => b.time.updated - a.time.updated)
|
.toSorted((a, b) => {
|
||||||
|
const updatedDay = new Date(b.time.updated).setHours(0, 0, 0, 0) - new Date(a.time.updated).setHours(0, 0, 0, 0)
|
||||||
|
if (updatedDay !== 0) return updatedDay
|
||||||
|
return b.time.created - a.time.created
|
||||||
|
})
|
||||||
.map((x) => {
|
.map((x) => {
|
||||||
const workspace = x.workspaceID ? project.workspace.get(x.workspaceID) : undefined
|
const workspace = x.workspaceID ? project.workspace.get(x.workspaceID) : undefined
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user