From 22c6b7813c74e167babc7d1ee9d9f5ea5a909e8c Mon Sep 17 00:00:00 2001 From: Pavel Laptev Date: Sun, 11 Feb 2024 20:42:29 +0100 Subject: [PATCH] chore: simplify code formatting and remove unnecessary code --- gitbutler-ui/src/lib/components/BranchCard.svelte | 5 +---- gitbutler-ui/src/lib/components/BranchLane.svelte | 4 +--- gitbutler-ui/src/lib/components/FileListItem.svelte | 6 ++---- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/gitbutler-ui/src/lib/components/BranchCard.svelte b/gitbutler-ui/src/lib/components/BranchCard.svelte index 12ac31e90..a80df6f04 100644 --- a/gitbutler-ui/src/lib/components/BranchCard.svelte +++ b/gitbutler-ui/src/lib/components/BranchCard.svelte @@ -50,10 +50,7 @@ let rsViewport: HTMLElement; const userSettings = getContext(SETTINGS_CONTEXT); - const defaultBranchWidthRem = persisted( - 24, - 'defaulBranchWidth' + project.id - ); + const defaultBranchWidthRem = persisted(24, 'defaulBranchWidth' + project.id); const laneWidthKey = 'laneWidth_'; let laneWidth: number; diff --git a/gitbutler-ui/src/lib/components/BranchLane.svelte b/gitbutler-ui/src/lib/components/BranchLane.svelte index ce7649117..94e1fe19d 100644 --- a/gitbutler-ui/src/lib/components/BranchLane.svelte +++ b/gitbutler-ui/src/lib/components/BranchLane.svelte @@ -103,9 +103,7 @@ selectable={$commitBoxOpen && !isUnapplied} on:close={() => { const selectedId = selected?.id; - selectedFiles.update((fileIds) => - fileIds.filter((file) => file.id != selectedId) - ); + selectedFiles.update((fileIds) => fileIds.filter((file) => file.id != selectedId)); }} /> { selectedOwnership.update((ownership) => { - if (e.detail) - file.hunks.forEach((h) => ownership.addHunk(file.id, h.id)); - if (!e.detail) - file.hunks.forEach((h) => ownership.removeHunk(file.id, h.id)); + if (e.detail) file.hunks.forEach((h) => ownership.addHunk(file.id, h.id)); + if (!e.detail) file.hunks.forEach((h) => ownership.removeHunk(file.id, h.id)); return ownership; }); }}