Skip to content

Commit

Permalink
Chat presenter: fixed not using AddressProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
DJTommek committed Jul 21, 2024
1 parent 980b512 commit b74e50c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/libs/Web/Chat/ChatPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Web\Chat;

use App\Address\AddressProvider;
use App\BetterLocation\ProcessExample;
use App\BetterLocation\ServicesManager;
use App\Chat;
Expand Down Expand Up @@ -36,6 +37,7 @@ public function __construct(
private readonly ServicesManager $servicesManager,
private readonly ClientInterface $httpClient,
private readonly ProcessExample $processExample,
private readonly AddressProvider $addressProvider,
ChatTemplate $template,
) {
$this->template = $template;
Expand Down Expand Up @@ -99,7 +101,12 @@ public function beforeRender(): void
}
}

$this->template->exampleLocation = $exampleCollection->getFirst();
$location = $exampleCollection->getFirst();
if ($this->chat->settingsShowAddress() && $location->hasAddress() === false) {
$location->setAddress($this->addressProvider->reverse($location)->getAddress());
}

$this->template->exampleLocation = $location;
$this->template->prepareOk($this->chatResponse, $this->servicesManager);
$this->template->chat = $this->chat;

Expand Down
1 change: 0 additions & 1 deletion src/templates/chat.latte
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@

{if $chat->settingsShowAddress()}
<br>
{$exampleLocation->generateAddress()}
{$exampleLocation->getAddress()}
{/if}

Expand Down

0 comments on commit b74e50c

Please sign in to comment.