Skip to content

Commit fbdba5b

Browse files
committed
Transfer: Hide rollback button for move operations
Move rollback doesn't actually restore source files — it only cleans up staging/destination. Hide the misleading button until proper move rollback is implemented. Copy rollback (deleting partial target files) still works and remains available.
1 parent a7507b2 commit fbdba5b

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

apps/desktop/src/lib/file-operations/transfer/TransferProgressDialog.svelte

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
const operationLabel = $derived(operationLabelMap[operationType])
112112
const operationGerund = $derived(operationGerundMap[operationType])
113113
const isDeleteOrTrash = $derived(operationType === 'delete' || operationType === 'trash')
114+
const isCopy = $derived(operationType === 'copy')
114115
115116
/** Whether this is a move involving an MTP volume (implemented as copy + delete). */
116117
const isMtpMove = $derived(
@@ -738,24 +739,33 @@
738739

739740
<!-- Cancel at bottom -->
740741
<div class="conflict-cancel">
741-
<button
742-
class="danger-text"
743-
onclick={() => handleCancel(true)}
744-
disabled={isCancelling || isResolvingConflict}
745-
>
746-
Rollback
747-
</button>
742+
{#if isCopy}
743+
<button
744+
class="danger-text"
745+
onclick={() => handleCancel(true)}
746+
disabled={isCancelling || isResolvingConflict}
747+
>
748+
Rollback
749+
</button>
750+
{:else}
751+
<button
752+
class="danger-text"
753+
onclick={() => handleCancel(false)}
754+
disabled={isCancelling || isResolvingConflict}
755+
>
756+
Cancel
757+
</button>
758+
{/if}
748759
</div>
749760
</div>
750-
{:else if !isDeleteOrTrash && isRollingBack}
751-
<!-- Rollback in progress (copy/move only) -->
761+
{:else if isCopy && isRollingBack}
762+
<!-- Rollback in progress (copy only) -->
752763
<div class="rollback-section">
753764
<div class="rollback-indicator">
754765
<span class="spinner spinner-md rollback-spinner"></span>
755766
</div>
756767
<p class="rollback-message">
757-
Deleting {filesDone}
758-
{operationType === 'copy' ? 'copied' : 'partially moved'} files...
768+
Deleting {filesDone} copied files...
759769
</p>
760770
</div>
761771
{:else}
@@ -827,7 +837,7 @@
827837
<!-- Action buttons -->
828838
<div class="button-row">
829839
<Button variant="secondary" onclick={() => handleCancel(false)} disabled={isCancelling}>Cancel</Button>
830-
{#if !isDeleteOrTrash && !(isMtpMove && mtpMovePhase === 'delete')}
840+
{#if isCopy}
831841
<span use:tooltip={'Cancel and delete any partial target files created'}>
832842
<Button variant="danger" onclick={() => handleCancel(true)} disabled={isCancelling}>Rollback</Button
833843
>

0 commit comments

Comments
 (0)