fix: prevent duplicate uploads and group asset commits

This commit is contained in:
Tom Boullay
2026-04-24 16:58:49 +02:00
parent fe8a6f0f54
commit 53c4c0ed60
15 changed files with 329 additions and 152 deletions
+16 -12
View File
@@ -1,5 +1,6 @@
interface ActionButtonsProps {
isUploading: boolean
isChecking: boolean
isSecretEmpty: boolean
hasPendingOrErrors: boolean
allDone: boolean
@@ -11,6 +12,7 @@ interface ActionButtonsProps {
export default function ActionButtons({
isUploading,
isChecking,
isSecretEmpty,
hasPendingOrErrors,
allDone,
@@ -19,11 +21,12 @@ export default function ActionButtons({
onCancel,
onReset,
}: ActionButtonsProps) {
const cantUpload = isSecretEmpty
const cantUpload = isSecretEmpty || isChecking
const isBusy = isUploading || isChecking
return (
<div className="flex gap-3">
{!isUploading && hasPendingOrErrors && (
{!isBusy && hasPendingOrErrors && (
<button
onClick={onUpload}
disabled={cantUpload}
@@ -38,18 +41,19 @@ export default function ActionButtons({
</button>
)}
{isUploading && (
<button
onClick={onCancel}
className="flex-1 bg-black-700 text-gray-300 font-medium text-sm
py-2.5 px-6 rounded-xl border border-black-600 transition-colors duration-150
{isBusy && (
<button
onClick={onCancel}
disabled={!isUploading}
className="flex-1 bg-black-700 text-gray-300 font-medium text-sm
py-2.5 px-6 rounded-xl border border-black-600 transition-colors duration-150 disabled:opacity-50 disabled:cursor-not-allowed
hover:bg-black-600"
>
Annuler
</button>
)}
>
{isChecking ? 'Verification...' : 'Annuler'}
</button>
)}
{(allDone || hasErrors) && !isUploading && (
{(allDone || hasErrors) && !isBusy && (
<button
onClick={onReset}
className="flex-1 bg-black-700 text-gray-300 font-medium text-sm