diff --git a/apps/updatenotification/lib/Controller/AdminController.php b/apps/updatenotification/lib/Controller/AdminController.php index 0a867f1267..e3139b42ed 100644 --- a/apps/updatenotification/lib/Controller/AdminController.php +++ b/apps/updatenotification/lib/Controller/AdminController.php @@ -86,9 +86,8 @@ class AdminController extends Controller implements ISettings { * @return TemplateResponse */ public function displayPanel() { - $lastUpdateCheck = $this->dateTimeFormatter->formatDateTime( - $this->config->getAppValue('core', 'lastupdatedat') - ); + $lastUpdateCheckTimestamp = $this->config->getAppValue('core', 'lastupdatedat'); + $lastUpdateCheck = $this->dateTimeFormatter->formatDateTime($lastUpdateCheckTimestamp); $channels = [ 'daily', @@ -108,6 +107,7 @@ class AdminController extends Controller implements ISettings { $params = [ 'isNewVersionAvailable' => !empty($updateState['updateAvailable']), + 'isUpdateChecked' => $lastUpdateCheckTimestamp > 0, 'lastChecked' => $lastUpdateCheck, 'currentChannel' => $currentChannel, 'channels' => $channels, diff --git a/apps/updatenotification/templates/admin.php b/apps/updatenotification/templates/admin.php index 369d4905a4..bda27abf25 100644 --- a/apps/updatenotification/templates/admin.php +++ b/apps/updatenotification/templates/admin.php @@ -6,6 +6,8 @@ $isNewVersionAvailable = $_['isNewVersionAvailable']; /** @var string $newVersionString */ $newVersionString = $_['newVersionString']; + /** @var bool $isUpdateChecked */ + $isUpdateChecked = $_['isUpdateChecked']; /** @var string $lastCheckedDate */ $lastCheckedDate = $_['lastChecked']; /** @var array $channels */ @@ -22,6 +24,8 @@ t('Download now')) ?> + + t('The update check is not yet finished. Please refresh the page.')); ?> t('Your version is up to date.')); ?> diff --git a/apps/updatenotification/tests/Controller/AdminControllerTest.php b/apps/updatenotification/tests/Controller/AdminControllerTest.php index 31e852a9e2..21e86b7c02 100644 --- a/apps/updatenotification/tests/Controller/AdminControllerTest.php +++ b/apps/updatenotification/tests/Controller/AdminControllerTest.php @@ -120,6 +120,7 @@ class AdminControllerTest extends TestCase { $params = [ 'isNewVersionAvailable' => true, + 'isUpdateChecked' => true, 'lastChecked' => 'LastCheckedReturnValue', 'currentChannel' => \OCP\Util::getChannel(), 'channels' => $channels, @@ -166,6 +167,7 @@ class AdminControllerTest extends TestCase { $params = [ 'isNewVersionAvailable' => false, + 'isUpdateChecked' => true, 'lastChecked' => 'LastCheckedReturnValue', 'currentChannel' => \OCP\Util::getChannel(), 'channels' => $channels,