fix(xo-web/config): sort backups from newest to oldest

Introduced by 01302d7a60
This commit is contained in:
Julien Fontanet 2024-02-12 10:55:26 +01:00
parent a2c36c0832
commit 92efd28b33
2 changed files with 6 additions and 1 deletions

View File

@ -13,6 +13,8 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Settings/XO Config] Sort backups from newest to oldest
### Packages to release
> When modifying a package, add it here with its release type.
@ -30,5 +32,6 @@
<!--packages-start-->
- xo-server patch
- xo-web patch
<!--packages-end-->

View File

@ -1099,7 +1099,9 @@ export const SelectXoCloudConfig = makeSubscriptionSelect(
subscriber =>
subscribeCloudXoConfigBackups(configs => {
const xoObjects = groupBy(
map(configs, config => ({ ...config, type: 'xoConfig' })),
map(configs, config => ({ ...config, type: 'xoConfig' }))
// from newest to oldest
.sort((a, b) => b.createdAt - a.createdAt),
'xoaId'
)
subscriber({