fix: prevent duplicate uploads and group asset commits
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user