diff --git a/app/stores/CollectionsStore.js b/app/stores/CollectionsStore.js index b09167be7a..b108c65858 100644 --- a/app/stores/CollectionsStore.js +++ b/app/stores/CollectionsStore.js @@ -35,7 +35,9 @@ export default class CollectionsStore extends BaseStore { @computed get orderedData(): Collection[] { return filter( - naturalSort(Array.from(this.data.values()), "index"), + naturalSort(Array.from(this.data.values()), "index", { + caseSensitive: true, + }), (d) => !d.deletedAt ); } diff --git a/server/utils/collectionIndexing.js b/server/utils/collectionIndexing.js index 6d9ec12823..a61d903e24 100644 --- a/server/utils/collectionIndexing.js +++ b/server/utils/collectionIndexing.js @@ -42,7 +42,7 @@ export default async function collectionIndexing(teamId: string) { let previousCollectionIndex = null; for (const collection of sortableCollections) { if (collection[1] === null) { - const index = fractionalIndex(collection[1], previousCollectionIndex); + const index = fractionalIndex(previousCollectionIndex, collection[1]); collection[0].index = index; await collection[0].save(); }