fix: broken download, added to queue alert, download list component; feat: monitor list
This commit is contained in:
23
src/Twig/Components/DownloadList.php
Normal file
23
src/Twig/Components/DownloadList.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Twig\Components;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;
|
||||
|
||||
#[AsTwigComponent]
|
||||
final class DownloadList extends AbstractController
|
||||
{
|
||||
public string $type;
|
||||
|
||||
public function getDownloads()
|
||||
{
|
||||
if ($this->type === "active") {
|
||||
return $this->getUser()->queryDownloads('in-progress', 5);
|
||||
} elseif ($this->type === "complete") {
|
||||
return $this->getUser()->queryDownloads('complete', 5);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user