Skip to content

Commit

Permalink
[web] - fix bug in DAO events sorting (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Matusevich authored Sep 15, 2023
1 parent 6b3066f commit ae89460
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 8 deletions.
5 changes: 4 additions & 1 deletion web/src/v1.0.0/store/dao.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ export const daoEventListSelector = selectorFamily<TDaoEventList, string | undef
return {
...data,
items: [...data.items].sort((a, b) => {
return a.updatedAt >= b.updatedAt ? -1 : 1
if (a.updatedAt === b.updatedAt) {
return 0
}
return a.updatedAt > b.updatedAt ? -1 : 1
}),
}
},
Expand Down
5 changes: 4 additions & 1 deletion web/src/v2.0.0/store/dao.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ export const daoEventListSelector = selectorFamily<TDaoEventList, string | undef
return {
...data,
items: [...data.items].sort((a, b) => {
return a.updatedAt >= b.updatedAt ? -1 : 1
if (a.updatedAt === b.updatedAt) {
return 0
}
return a.updatedAt > b.updatedAt ? -1 : 1
}),
}
},
Expand Down
5 changes: 4 additions & 1 deletion web/src/v3.0.0/store/dao.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ export const daoEventListSelector = selectorFamily<TDaoEventList, string | undef
return {
...data,
items: [...data.items].sort((a, b) => {
return a.updatedAt >= b.updatedAt ? -1 : 1
if (a.updatedAt === b.updatedAt) {
return 0
}
return a.updatedAt > b.updatedAt ? -1 : 1
}),
}
},
Expand Down
5 changes: 4 additions & 1 deletion web/src/v4.0.0/store/dao.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ export const daoEventListSelector = selectorFamily<TDaoEventList, string | undef
return {
...data,
items: [...data.items].sort((a, b) => {
return a.updatedAt >= b.updatedAt ? -1 : 1
if (a.updatedAt === b.updatedAt) {
return 0
}
return a.updatedAt > b.updatedAt ? -1 : 1
}),
}
},
Expand Down
5 changes: 4 additions & 1 deletion web/src/v5.0.0/store/dao.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ export const daoEventListSelector = selectorFamily<TDaoEventList, string | undef
return {
...data,
items: [...data.items].sort((a, b) => {
return a.updatedAt >= b.updatedAt ? -1 : 1
if (a.updatedAt === b.updatedAt) {
return 0
}
return a.updatedAt > b.updatedAt ? -1 : 1
}),
}
},
Expand Down
5 changes: 4 additions & 1 deletion web/src/v5.1.0/store/dao.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ export const daoEventListSelector = selectorFamily<TDaoEventList, string | undef
return {
...data,
items: [...data.items].sort((a, b) => {
return a.updatedAt >= b.updatedAt ? -1 : 1
if (a.updatedAt === b.updatedAt) {
return 0
}
return a.updatedAt > b.updatedAt ? -1 : 1
}),
}
},
Expand Down
5 changes: 4 additions & 1 deletion web/src/v6.0.0/store/dao.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ export const daoEventListSelector = selectorFamily<TDaoEventList, string | undef
return {
...data,
items: [...data.items].sort((a, b) => {
return a.updatedAt >= b.updatedAt ? -1 : 1
if (a.updatedAt === b.updatedAt) {
return 0
}
return a.updatedAt > b.updatedAt ? -1 : 1
}),
}
},
Expand Down
5 changes: 4 additions & 1 deletion web/src/v6.1.0/store/dao.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ export const daoEventListSelector = selectorFamily<TDaoEventList, string | undef
return {
...data,
items: [...data.items].sort((a, b) => {
return a.updatedAt >= b.updatedAt ? -1 : 1
if (a.updatedAt === b.updatedAt) {
return 0
}
return a.updatedAt > b.updatedAt ? -1 : 1
}),
}
},
Expand Down

0 comments on commit ae89460

Please sign in to comment.