mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 19:21:36 +00:00
fix: only set s3DownloadedFile when download actually completes
The s3DownloadedFile was being set immediately when download started, causing the "Restore" button to appear while still downloading and the download message to not hide properly. - Remove immediate setting of s3DownloadedFile in downloadFromS3() - Set s3DownloadedFile only in handleS3DownloadFinished() event handler - Add broadcastWith() to S3DownloadFinished to send downloadPath - Store downloadPath as public property for broadcasting - Now download message hides and restore button shows only when complete 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -78,9 +78,16 @@ class Import extends Component
|
||||
];
|
||||
}
|
||||
|
||||
public function handleS3DownloadFinished(): void
|
||||
public function handleS3DownloadFinished($data): void
|
||||
{
|
||||
$this->s3DownloadInProgress = false;
|
||||
|
||||
// Set the downloaded file path from the event data
|
||||
$downloadPath = data_get($data, 'downloadPath');
|
||||
if (filled($downloadPath)) {
|
||||
$this->s3DownloadedFile = $downloadPath;
|
||||
$this->filename = $downloadPath;
|
||||
}
|
||||
}
|
||||
|
||||
public function mount()
|
||||
@@ -408,9 +415,6 @@ EOD;
|
||||
'resourceUuid' => $this->resource->uuid,
|
||||
]);
|
||||
|
||||
$this->s3DownloadedFile = $downloadPath;
|
||||
$this->filename = $downloadPath;
|
||||
|
||||
$this->dispatch('activityMonitor', $activity->id);
|
||||
$this->dispatch('info', 'Downloading file from S3. This may take a few minutes for large backups...');
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
Reference in New Issue
Block a user