better animation

This commit is contained in:
Avently
2024-02-22 19:48:05 +07:00
parent ade02fd873
commit 90f333cfc6

View File

@@ -456,11 +456,13 @@ struct MigrateToAnotherDevice: View {
await MainActor.run {
switch msg {
case let .sndFileProgressXFTP(_, _, fileTransferMeta, sentSize, totalSize):
if case .uploadProgress = migrationState {
if case let .uploadProgress(uploaded, total, _, _, _) = migrationState, uploaded != total {
migrationState = .uploadProgress(uploadedBytes: sentSize, totalBytes: totalSize, fileId: fileTransferMeta.fileId, archivePath: archivePath, ctrl: ctrl)
}
case let .sndFileRedirectStartXFTP(_, fileTransferMeta, _):
migrationState = .linkCreation(totalBytes: fileTransferMeta.fileSize)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
migrationState = .linkCreation(totalBytes: fileTransferMeta.fileSize)
}
case let .sndStandaloneFileComplete(_, fileTransferMeta, rcvURIs):
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
migrationState = .linkShown(fileId: fileTransferMeta.fileId, link: rcvURIs[0], archivePath: archivePath, ctrl: ctrl)