Resolve bug in ordering the collections

This commit is contained in:
Saumya Pandey committed 2021-03-05 12:09:56 +05:30
1 parent 3c40aa4be0
commit 59affbcc7e
2 files changed
+4 -2

No files matched your search

+3 -1
View File
@@ -35,7 +35,9 @@ export default class CollectionsStore extends BaseStore<Collection> {
@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
);
}
+1 -1
View File
@@ -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();
}