1
0

Enable push button only if there are commits in the repository

This commit is contained in:
Victor Giers
2025-11-27 11:39:43 +01:00
parent 9bf17a7eac
commit f38af64e40

View File

@@ -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';