mirror of
https://github.com/tiennm99/coolify.git
synced 2026-05-12 18:57:54 +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:
@@ -15,6 +15,8 @@ class S3DownloadFinished implements ShouldBroadcast
|
||||
|
||||
public int|string|null $userId = null;
|
||||
|
||||
public ?string $downloadPath = null;
|
||||
|
||||
public function __construct($teamId, $data = null)
|
||||
{
|
||||
if (is_null($data)) {
|
||||
@@ -23,6 +25,7 @@ class S3DownloadFinished implements ShouldBroadcast
|
||||
|
||||
// Get userId from event data (the user who triggered the download)
|
||||
$this->userId = data_get($data, 'userId');
|
||||
$this->downloadPath = data_get($data, 'downloadPath');
|
||||
|
||||
$containerName = data_get($data, 'containerName');
|
||||
$serverId = data_get($data, 'serverId');
|
||||
@@ -46,4 +49,11 @@ class S3DownloadFinished implements ShouldBroadcast
|
||||
new PrivateChannel("user.{$this->userId}"),
|
||||
];
|
||||
}
|
||||
|
||||
public function broadcastWith(): array
|
||||
{
|
||||
return [
|
||||
'downloadPath' => $this->downloadPath,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user