From f38af64e40048f34febbbde658cc0e5113c31f8a Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 27 Nov 2025 11:39:43 +0100 Subject: [PATCH] Enable push button only if there are commits in the repository --- renderer.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/renderer.js b/renderer.js index 9a75568..9605389 100644 --- a/renderer.js +++ b/renderer.js @@ -510,6 +510,11 @@ window.addEventListener('DOMContentLoaded', async () => { initRepoBtn.classList.add('hidden'); } + const commitCount = await window.electronAPI.getCommitCount(folderObj); + const hasCommits = commitCount > 0; + pushBtn.classList.toggle('hidden', !hasCommits); + pushBtn.disabled = !hasCommits; + // Jetzt erst den Readme-Button-Text aktualisieren: const hasReadme = await window.electronAPI.hasReadme(folder); readmeBtn.textContent = hasReadme ? 'Update README' : 'Generate README';