From d3e29da1e48b22828c86e5544c4f8761ee54a4b8 Mon Sep 17 00:00:00 2001 From: MontaGhanmy Date: Thu, 24 Oct 2024 14:43:05 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Release=20Version=201.0.4-hf2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/orm/connectors/mongodb/mongodb.ts | 6 +----- tdrive/backend/node/src/version.ts | 6 +++--- tdrive/frontend/src/app/environment/version.ts | 4 ++-- .../app/features/drive/hooks/use-drive-item.tsx | 16 ++++++++-------- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/tdrive/backend/node/src/core/platform/services/database/services/orm/connectors/mongodb/mongodb.ts b/tdrive/backend/node/src/core/platform/services/database/services/orm/connectors/mongodb/mongodb.ts index 7958110a..55c7c2bf 100644 --- a/tdrive/backend/node/src/core/platform/services/database/services/orm/connectors/mongodb/mongodb.ts +++ b/tdrive/backend/node/src/core/platform/services/database/services/orm/connectors/mongodb/mongodb.ts @@ -287,11 +287,7 @@ export class MongoConnector extends AbstractConnector { .find(query) .sort(sort) .skip(Math.max(0, parseInt(options.pagination.page_token || "0"))) - .limit(Math.max(0, parseInt(options.pagination.limitStr || "100"))) - .collation({ - locale: "en_US", - numericOrdering: true, - }); + .limit(Math.max(0, parseInt(options.pagination.limitStr || "100"))); const entities: Table[] = []; while (await cursor.hasNext()) { diff --git a/tdrive/backend/node/src/version.ts b/tdrive/backend/node/src/version.ts index b047764c..aba10f0d 100644 --- a/tdrive/backend/node/src/version.ts +++ b/tdrive/backend/node/src/version.ts @@ -1,7 +1,7 @@ export default { - current: /* @VERSION_DETAIL */ "1.0.4-hf1", + current: /* @VERSION_DETAIL */ "1.0.4-hf2", minimal: { - web: /* @MIN_VERSION_WEB */ "1.0.4-hf1", - mobile: /* @MIN_VERSION_MOBILE */ "1.0.4-hf1", + web: /* @MIN_VERSION_WEB */ "1.0.4-hf2", + mobile: /* @MIN_VERSION_MOBILE */ "1.0.4-hf2", }, }; diff --git a/tdrive/frontend/src/app/environment/version.ts b/tdrive/frontend/src/app/environment/version.ts index f98e2a81..1ae3445e 100644 --- a/tdrive/frontend/src/app/environment/version.ts +++ b/tdrive/frontend/src/app/environment/version.ts @@ -1,5 +1,5 @@ export default { - version: /* @VERSION */ '1.0.4-hf1', - version_detail: /* @VERSION_DETAIL */ '1.0.4-hf1', + version: /* @VERSION */ '1.0.4-hf2', + version_detail: /* @VERSION_DETAIL */ '1.0.4-hf2', version_name: /* @VERSION_NAME */ 'Ghost-Dog', }; \ No newline at end of file diff --git a/tdrive/frontend/src/app/features/drive/hooks/use-drive-item.tsx b/tdrive/frontend/src/app/features/drive/hooks/use-drive-item.tsx index 7f2716ca..dde7d72e 100644 --- a/tdrive/frontend/src/app/features/drive/hooks/use-drive-item.tsx +++ b/tdrive/frontend/src/app/features/drive/hooks/use-drive-item.tsx @@ -122,13 +122,13 @@ export const useDriveItem = (id: string) => { })); } // set children and remove duplicates - setChildren(prev => [ - ...prev, - ...details.children.filter( - (item, index, self) => - index === self.findIndex(t => t.id === item.id), - ), - ]); + setChildren(prev => { + // Create a Map for existing IDs for fast lookups + const existingIds = new Map(prev.map(item => [item.id, true])); + + // Filter children while adding them to the state + return [...prev, ...details.children.filter(item => !existingIds.has(item.id))]; + }); } catch (e) { // set pagination end to true set(DriveItemPagination, prev => ({ @@ -140,7 +140,7 @@ export const useDriveItem = (id: string) => { } finally { set(DriveItemPagination, prev => ({ ...prev, - page: (prev.page + prev.limit), + page: prev.page + prev.limit, })); } setLoading(false);