fix(core): provide valid initial state also on public templates

The `core apps` initial state should be an array of apps currently
available. But for public templates when there is no navigation entry
the array would contain `[null]` instead of `[]` which breaks some use
cases (e.g. apps that rely on some nextcloud-vue versions).

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2026-04-27 19:07:40 +02:00
parent 6afd7bfcf6
commit 767b6c25c7
No known key found for this signature in database
GPG key ID: 7E849AE05218500F

View file

@ -163,7 +163,8 @@ class TemplateLayout {
$page->assign('appid', $appId);
$page->assign('bodyid', 'body-public');
$this->initialState->provideInitialState('core', 'apps', [$this->navigationManager->get($appId)]);
$currentAppData = $this->navigationManager->get($appId);
$this->initialState->provideInitialState('core', 'apps', $currentAppData === null ? [] : [$currentAppData]);
// Set logo link target
$logoUrl = $this->config->getSystemValueString('logo_url', '');