perf(push): Only get user language when needed

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2024-04-09 14:28:38 +02:00
Родитель c25f598709
Коммит e4bd0dc554
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 74434EFE0D2E2205
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -303,10 +303,10 @@ class Push {
$this->printInfo('Trying to push to ' . count($devices) . ' devices');
$this->printInfo('');
$language = $this->l10nFactory->getUserLanguage($user);
$this->printInfo('Language is set to ' . $language);
if (!$notification->isValidParsed()) {
$language = $this->l10nFactory->getUserLanguage($user);
$this->printInfo('Language is set to ' . $language);
try {
$this->notificationManager->setPreparingPushNotification(true);
$notification = $this->notificationManager->prepare($notification, $language);