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

View File

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