From d838bd4960074a0be12d3341e39674d0a0cc678a Mon Sep 17 00:00:00 2001 From: voidarc Date: Sun, 15 Nov 2026 17:56:08 +0000 Subject: [PATCH] added diff to commits --- src/lib/server/gitea.ts | 7 ++++--- src/routes/Commits.svelte | 14 +++++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/lib/server/gitea.ts b/src/lib/server/gitea.ts index b7fcd17..0146147 100644 --- a/src/lib/server/gitea.ts +++ b/src/lib/server/gitea.ts @@ -52,9 +52,10 @@ async function getRepoCommits(fetch: typeof globalThis.fetch, url: string) { let finalData = []; for (let commit of data) { - // Filter out other users - if (commit.author.login == 'voidarc') { + // Filter out other users and do a null check for non-gitea commits that might exist + if (commit.author != null && commit.author.login == 'voidarc') { finalData.push(commit); + } else { } } @@ -71,7 +72,7 @@ async function fetchLatestCommits( for (let repo of repos) { let commits = await getRepoCommits(fetch, repo.url); for (let commit of commits) { - console.log(commit); + // console.log(commit); let newCommit: GitCommit = { message: commit.commit.message, hash: commit.sha, diff --git a/src/routes/Commits.svelte b/src/routes/Commits.svelte index 4ca7f81..349edd2 100644 --- a/src/routes/Commits.svelte +++ b/src/routes/Commits.svelte @@ -206,7 +206,19 @@ {commit.shortHash}
{commit.message}