Fix lock tooltip closure shadowing commit variable

This commit is contained in:
Mattias Granlund 2024-04-25 23:45:58 +02:00
parent 311a582a8c
commit a91153aff3
2 changed files with 3 additions and 3 deletions

View File

@ -55,7 +55,7 @@
<div class="indicators text-base-11">
<span class="added">+{added}</span>
<span class="removed">-{removed}</span>
{#if section.hunk.lockedTo && commits}
{#if section.hunk.lockedTo && section.hunk.lockedTo.length > 0 && commits}
<div
use:tooltip={{
text: getLockText(section.hunk.lockedTo, commits),

View File

@ -9,8 +9,8 @@ export function getLockText(hunkLocks: HunkLock | HunkLock[] | string, commits:
const descriptions = locks
.filter(unique)
.map((lock) => {
const commit = commits.find((commit) => {
commit.id == lock.commitId;
const commit = commits.find((c) => {
return c.id == lock.commitId;
});
const shortCommitId = commit?.id.slice(0, 7);
if (commit) {