Skip to content

Commit ef9fcbc

Browse files
authored
Merge pull request #4386 from nextcloud/enh/version-check
report app version in AppSettings to frontend
2 parents 1a86a99 + 853b3fa commit ef9fcbc

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

lib/AppInfo/Application.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
use OCA\Polls\Provider\ReferenceProvider;
6161
use OCA\Polls\Provider\SearchProvider;
6262
use OCA\Polls\UserSession;
63+
use OCP\App\IAppManager;
6364
use OCP\AppFramework\App;
6465
use OCP\AppFramework\Bootstrap\IBootContext;
6566
use OCP\AppFramework\Bootstrap\IBootstrap;
@@ -155,6 +156,7 @@ private function registerServices(IRegistrationContext $context): void {
155156
$c->get(UserSession::class),
156157
$c->get(SystemSettings::class),
157158
$c->get(LoggerInterface::class),
159+
$c->get(IAppManager::class),
158160
);
159161
});
160162

lib/Model/Settings/AppSettings.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use OCA\Polls\AppConstants;
1313
use OCA\Polls\Model\Group\Group;
1414
use OCA\Polls\UserSession;
15+
use OCP\App\IAppManager;
1516
use OCP\IAppConfig;
1617
use Psr\Log\LoggerInterface;
1718

@@ -70,6 +71,7 @@ public function __construct(
7071
private UserSession $userSession,
7172
private SystemSettings $systemSettings,
7273
protected LoggerInterface $logger,
74+
protected IAppManager $appManager,
7375
) {
7476
}
7577

@@ -101,6 +103,7 @@ public function getAppSettings(): array {
101103
'useActivity' => false,
102104
'navigationPollsInList' => false,
103105
'updateType' => $this->getUpdateType(),
106+
'currentVersion' => $this->appManager->getAppVersion(AppConstants::APP_ID),
104107
];
105108

106109
if ($this->userSession->getIsLoggedIn()) {

0 commit comments

Comments
 (0)