diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-08-02 10:45:26 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-08-02 10:45:26 +0200 |
commit | 7f2e9d10a3ce0b1f2bcddcaad32b57e945b4e0ca (patch) | |
tree | d1a3c793a9bff1b2ae1bc9d7e73452be6f661e49 /apps/updatenotification/lib | |
parent | 45d080d70e2b34161103aee21478c3745e9b5700 (diff) | |
download | nextcloud-server-7f2e9d10a3ce0b1f2bcddcaad32b57e945b4e0ca.tar.gz nextcloud-server-7f2e9d10a3ce0b1f2bcddcaad32b57e945b4e0ca.zip |
Show correct status in update notification
Sometimes it could be the case that after a channel change the last updated
timestamp is reset, but the check for updates is not yet completed. In this
case the update notification showed "You are up to date" and the date was
"1970-01-01 00:00:00". With this fix the state is properly shown.
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/updatenotification/lib')
-rw-r--r-- | apps/updatenotification/lib/Controller/AdminController.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/updatenotification/lib/Controller/AdminController.php b/apps/updatenotification/lib/Controller/AdminController.php index 0a867f1267c..e3139b42ed2 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, |