From fe30db9760e0a8f6346a08a6b76349b889e3cf4d Mon Sep 17 00:00:00 2001 From: Caleb Owens Date: Fri, 3 May 2024 19:49:40 +0100 Subject: [PATCH] Change metric for "undoable" We have two types of commits "RemoteCommit" and "Commit". "RemoteCommit" are what we see in the "Upstream" section, and in branches. These commits can't be undone. Commits of type "Commit" appear in the "Local" and "Remote" sections and are undoable --- app/src/lib/components/CommitCard.svelte | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/lib/components/CommitCard.svelte b/app/src/lib/components/CommitCard.svelte index 715dba219..b0684b2f7 100644 --- a/app/src/lib/components/CommitCard.svelte +++ b/app/src/lib/components/CommitCard.svelte @@ -86,7 +86,13 @@ branchController.reorderCommit(branch.id, commit.id, offset); } - $: isUndoable = isHeadCommit; + let isUndoable = false; + + $: if ($advancedCommitOperations) { + isUndoable = !!branch?.active && commit instanceof Commit; + } else { + isUndoable = isHeadCommit; + } const hasCommitUrl = !commit.isLocal && commitUrl; let commitMessageModal: Modal;