aboutsummaryrefslogtreecommitdiffstats
path: root/apps/updatenotification
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-07-08 16:23:52 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-07-10 01:35:24 +0200
commita96b5940dd9d80c6ea6fbb5faa6ef7d1a7cc6734 (patch)
treeb6d0368a9e25c52dfcbb28f8a816dfbfd77f4ff8 /apps/updatenotification
parent4fc77eca47947e833f371253d80db0cc0cad4fbf (diff)
downloadnextcloud-server-a96b5940dd9d80c6ea6fbb5faa6ef7d1a7cc6734.tar.gz
nextcloud-server-a96b5940dd9d80c6ea6fbb5faa6ef7d1a7cc6734.zip
chore: Make active apps initial state consistent with OCS API
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/updatenotification')
-rw-r--r--apps/updatenotification/src/init.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/updatenotification/src/init.ts b/apps/updatenotification/src/init.ts
index ebfbf68996a..d82272bf4b2 100644
--- a/apps/updatenotification/src/init.ts
+++ b/apps/updatenotification/src/init.ts
@@ -2,13 +2,15 @@
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
+import type { INavigationEntry } from '../../../core/src/types/navigation'
+
import { subscribe } from '@nextcloud/event-bus'
import { loadState } from '@nextcloud/initial-state'
import { generateOcsUrl } from '@nextcloud/router'
import Vue, { defineAsyncComponent } from 'vue'
import axios from '@nextcloud/axios'
-const navigationEntries = loadState('core', 'apps', {})
+const navigationEntries = loadState<INavigationEntry[]>('core', 'apps', [])
const DialogVue = defineAsyncComponent(() => import('./components/AppChangelogDialog.vue'))
@@ -39,8 +41,9 @@ function showDialog(appId: string, version?: string) {
dialog.$destroy?.()
resolve(dismissed)
- if (dismissed && appId in navigationEntries) {
- window.location = navigationEntries[appId].href
+ const app = navigationEntries.find(({ app }) => app === appId)
+ if (dismissed && app !== undefined) {
+ window.location.href = app.href
}
}
},