chore: simplify code formatting and remove unnecessary code

This commit is contained in:
Pavel Laptev 2024-02-11 20:42:29 +01:00 committed by GitButler
parent 5e6d5c466b
commit 22c6b7813c
3 changed files with 4 additions and 11 deletions

View File

@ -50,10 +50,7 @@
let rsViewport: HTMLElement; let rsViewport: HTMLElement;
const userSettings = getContext<SettingsStore>(SETTINGS_CONTEXT); const userSettings = getContext<SettingsStore>(SETTINGS_CONTEXT);
const defaultBranchWidthRem = persisted<number | undefined>( const defaultBranchWidthRem = persisted<number | undefined>(24, 'defaulBranchWidth' + project.id);
24,
'defaulBranchWidth' + project.id
);
const laneWidthKey = 'laneWidth_'; const laneWidthKey = 'laneWidth_';
let laneWidth: number; let laneWidth: number;

View File

@ -103,9 +103,7 @@
selectable={$commitBoxOpen && !isUnapplied} selectable={$commitBoxOpen && !isUnapplied}
on:close={() => { on:close={() => {
const selectedId = selected?.id; const selectedId = selected?.id;
selectedFiles.update((fileIds) => selectedFiles.update((fileIds) => fileIds.filter((file) => file.id != selectedId));
fileIds.filter((file) => file.id != selectedId)
);
}} }}
/> />
<Resizer <Resizer

View File

@ -56,10 +56,8 @@
{indeterminate} {indeterminate}
on:change={(e) => { on:change={(e) => {
selectedOwnership.update((ownership) => { selectedOwnership.update((ownership) => {
if (e.detail) if (e.detail) file.hunks.forEach((h) => ownership.addHunk(file.id, h.id));
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.removeHunk(file.id, h.id));
return ownership; return ownership;
}); });
}} }}