From 435d631b431bdc739df2a816504e9d02b6edd19e Mon Sep 17 00:00:00 2001 From: Dylan Decrulle Date: Tue, 5 Nov 2024 17:31:25 +0100 Subject: [PATCH] small refacto --- web/src/core/usecases/fileExplorer/state.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/web/src/core/usecases/fileExplorer/state.ts b/web/src/core/usecases/fileExplorer/state.ts index d5962ce20..f1bd4b103 100644 --- a/web/src/core/usecases/fileExplorer/state.ts +++ b/web/src/core/usecases/fileExplorer/state.ts @@ -218,15 +218,14 @@ export const { reducer, actions } = createUsecaseActions({ } switch (ongoingOperation.operation) { - case "create": { - state.objects = state.objects.map(obj => { - const matchingObject = objects.find( - o => o.basename === obj.basename && o.kind === obj.kind - ); - return matchingObject ? matchingObject : obj; - }); + case "create": + state.objects = state.objects.map( + obj => + objects.find( + o => o.basename === obj.basename && o.kind === obj.kind + ) || obj + ); break; - } } }, "commandLogIssued": (