mirror of
https://github.com/outline/outline.git
synced 2026-11-23 06:11:04 +03:00
Resolve bug in ordering the collections
This commit is contained in:
1 parent
3c40aa4be0
commit
59affbcc7e
2 files changed
+4
-2
No files matched your search
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user