diff --git a/packages/web-app-notes/src/index.ts b/packages/web-app-notes/src/index.ts index e220cdda..e34831b6 100644 --- a/packages/web-app-notes/src/index.ts +++ b/packages/web-app-notes/src/index.ts @@ -3,7 +3,8 @@ import { defineWebApplication, AppMenuItemExtension, ApplicationInformation, - AppWrapperRoute + AppWrapperRoute, + useUserStore } from '@opencloud-eu/web-pkg' import { urlJoin } from '@opencloud-eu/web-client' import translations from '../l10n/translations.json' @@ -16,6 +17,7 @@ import View from './views/View.vue' export default defineWebApplication({ setup() { const { $gettext } = useGettext() + const userStore = useUserStore() const routes = [ { @@ -59,6 +61,7 @@ export default defineWebApplication({ } const menuItems = computed(() => { + if (!userStore.user) return [] return [ { id: `app.${appInfo.id}.menuItem`, diff --git a/packages/web-app-pastebin/src/index.ts b/packages/web-app-pastebin/src/index.ts index 5ac12e4d..f6cf961e 100644 --- a/packages/web-app-pastebin/src/index.ts +++ b/packages/web-app-pastebin/src/index.ts @@ -4,7 +4,8 @@ import { AppMenuItemExtension, AppWrapperRoute, ApplicationInformation, - defineWebApplication + defineWebApplication, + useUserStore } from '@opencloud-eu/web-pkg' import { urlJoin } from '@opencloud-eu/web-client' import { computed } from 'vue' @@ -21,6 +22,7 @@ const applicationId = 'pastebin' export default defineWebApplication({ setup() { const { $gettext } = useGettext() + const userStore = useUserStore() const routes = [ { @@ -78,16 +80,19 @@ export default defineWebApplication({ ] } - const menuItems = computed(() => [ - { - id: `app.${applicationId}.menuItem`, - type: 'appMenuItem', - label: () => $gettext('Pastebin'), - icon: 'upload', - path: urlJoin(applicationId), - color: 'white' - } - ]) + const menuItems = computed(() => { + if (!userStore.user) return [] + return [ + { + id: `app.${applicationId}.menuItem`, + type: 'appMenuItem', + label: () => $gettext('Pastebin'), + icon: 'upload', + path: urlJoin(applicationId), + color: 'white' + } + ] + }) return { appInfo,