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
This commit is contained in:
Caleb Owens 2024-05-03 19:49:40 +01:00
parent 601d6ba809
commit fe30db9760

View File

@ -86,7 +86,13 @@
branchController.reorderCommit(branch.id, commit.id, offset); 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; const hasCommitUrl = !commit.isLocal && commitUrl;
let commitMessageModal: Modal; let commitMessageModal: Modal;