feat: when a commit is undone, the commit message box will be pre-filled with the last message

This commit is contained in:
Kiril Videlov 2024-02-17 20:29:16 +01:00 committed by Kiril Videlov
parent 2a48b7f072
commit 029377be06

View File

@ -3,6 +3,7 @@
import Button from '$lib/components/Button.svelte';
import Tag from '$lib/components/Tag.svelte';
import TimeAgo from '$lib/components/TimeAgo.svelte';
import { projectCurrentCommitMessage, projectLastCommitMessage } from '$lib/config/config';
import { draggable } from '$lib/dragging/draggable';
import { draggableCommit, nonDraggable } from '$lib/dragging/draggables';
import { openExternalUrl } from '$lib/utils/url';
@ -21,6 +22,8 @@
export let selectedFiles: Writable<(LocalFile | RemoteFile)[]>;
const selectedOwnership = writable(Ownership.default());
const currentCommitMessage = projectCurrentCommitMessage(projectId);
const lastCommitMessage = projectLastCommitMessage(projectId);
let showFiles = false;
@ -55,6 +58,7 @@
border
clickable
on:click={(e) => {
currentCommitMessage.set($lastCommitMessage);
e.stopPropagation();
resetHeadCommit();
}}>Undo</Tag