From ae89460b5750c95cae5ca7964d9ad928ca97386b Mon Sep 17 00:00:00 2001 From: Roman Matusevich Date: Fri, 15 Sep 2023 18:15:41 +0300 Subject: [PATCH] [web] - fix bug in DAO events sorting (#577) --- web/src/v1.0.0/store/dao.state.ts | 5 ++++- web/src/v2.0.0/store/dao.state.ts | 5 ++++- web/src/v3.0.0/store/dao.state.ts | 5 ++++- web/src/v4.0.0/store/dao.state.ts | 5 ++++- web/src/v5.0.0/store/dao.state.ts | 5 ++++- web/src/v5.1.0/store/dao.state.ts | 5 ++++- web/src/v6.0.0/store/dao.state.ts | 5 ++++- web/src/v6.1.0/store/dao.state.ts | 5 ++++- 8 files changed, 32 insertions(+), 8 deletions(-) diff --git a/web/src/v1.0.0/store/dao.state.ts b/web/src/v1.0.0/store/dao.state.ts index e3cb8edcd..8d330b880 100644 --- a/web/src/v1.0.0/store/dao.state.ts +++ b/web/src/v1.0.0/store/dao.state.ts @@ -145,7 +145,10 @@ export const daoEventListSelector = selectorFamily { - return a.updatedAt >= b.updatedAt ? -1 : 1 + if (a.updatedAt === b.updatedAt) { + return 0 + } + return a.updatedAt > b.updatedAt ? -1 : 1 }), } }, diff --git a/web/src/v2.0.0/store/dao.state.ts b/web/src/v2.0.0/store/dao.state.ts index 8d742bdd2..d70c3ba16 100644 --- a/web/src/v2.0.0/store/dao.state.ts +++ b/web/src/v2.0.0/store/dao.state.ts @@ -149,7 +149,10 @@ export const daoEventListSelector = selectorFamily { - return a.updatedAt >= b.updatedAt ? -1 : 1 + if (a.updatedAt === b.updatedAt) { + return 0 + } + return a.updatedAt > b.updatedAt ? -1 : 1 }), } }, diff --git a/web/src/v3.0.0/store/dao.state.ts b/web/src/v3.0.0/store/dao.state.ts index 1bfa0bf7c..9f225f4e4 100644 --- a/web/src/v3.0.0/store/dao.state.ts +++ b/web/src/v3.0.0/store/dao.state.ts @@ -150,7 +150,10 @@ export const daoEventListSelector = selectorFamily { - return a.updatedAt >= b.updatedAt ? -1 : 1 + if (a.updatedAt === b.updatedAt) { + return 0 + } + return a.updatedAt > b.updatedAt ? -1 : 1 }), } }, diff --git a/web/src/v4.0.0/store/dao.state.ts b/web/src/v4.0.0/store/dao.state.ts index 1bfa0bf7c..9f225f4e4 100644 --- a/web/src/v4.0.0/store/dao.state.ts +++ b/web/src/v4.0.0/store/dao.state.ts @@ -150,7 +150,10 @@ export const daoEventListSelector = selectorFamily { - return a.updatedAt >= b.updatedAt ? -1 : 1 + if (a.updatedAt === b.updatedAt) { + return 0 + } + return a.updatedAt > b.updatedAt ? -1 : 1 }), } }, diff --git a/web/src/v5.0.0/store/dao.state.ts b/web/src/v5.0.0/store/dao.state.ts index 1bfa0bf7c..9f225f4e4 100644 --- a/web/src/v5.0.0/store/dao.state.ts +++ b/web/src/v5.0.0/store/dao.state.ts @@ -150,7 +150,10 @@ export const daoEventListSelector = selectorFamily { - return a.updatedAt >= b.updatedAt ? -1 : 1 + if (a.updatedAt === b.updatedAt) { + return 0 + } + return a.updatedAt > b.updatedAt ? -1 : 1 }), } }, diff --git a/web/src/v5.1.0/store/dao.state.ts b/web/src/v5.1.0/store/dao.state.ts index 1bfa0bf7c..9f225f4e4 100644 --- a/web/src/v5.1.0/store/dao.state.ts +++ b/web/src/v5.1.0/store/dao.state.ts @@ -150,7 +150,10 @@ export const daoEventListSelector = selectorFamily { - return a.updatedAt >= b.updatedAt ? -1 : 1 + if (a.updatedAt === b.updatedAt) { + return 0 + } + return a.updatedAt > b.updatedAt ? -1 : 1 }), } }, diff --git a/web/src/v6.0.0/store/dao.state.ts b/web/src/v6.0.0/store/dao.state.ts index 1bfa0bf7c..9f225f4e4 100644 --- a/web/src/v6.0.0/store/dao.state.ts +++ b/web/src/v6.0.0/store/dao.state.ts @@ -150,7 +150,10 @@ export const daoEventListSelector = selectorFamily { - return a.updatedAt >= b.updatedAt ? -1 : 1 + if (a.updatedAt === b.updatedAt) { + return 0 + } + return a.updatedAt > b.updatedAt ? -1 : 1 }), } }, diff --git a/web/src/v6.1.0/store/dao.state.ts b/web/src/v6.1.0/store/dao.state.ts index 1bfa0bf7c..9f225f4e4 100644 --- a/web/src/v6.1.0/store/dao.state.ts +++ b/web/src/v6.1.0/store/dao.state.ts @@ -150,7 +150,10 @@ export const daoEventListSelector = selectorFamily { - return a.updatedAt >= b.updatedAt ? -1 : 1 + if (a.updatedAt === b.updatedAt) { + return 0 + } + return a.updatedAt > b.updatedAt ? -1 : 1 }), } },