Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/web-app-notes/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -16,6 +17,7 @@ import View from './views/View.vue'
export default defineWebApplication({
setup() {
const { $gettext } = useGettext()
const userStore = useUserStore()

const routes = [
{
Expand Down Expand Up @@ -59,6 +61,7 @@ export default defineWebApplication({
}

const menuItems = computed<AppMenuItemExtension[]>(() => {
if (!userStore.user) return []
return [
{
id: `app.${appInfo.id}.menuItem`,
Expand Down
27 changes: 16 additions & 11 deletions packages/web-app-pastebin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -21,6 +22,7 @@ const applicationId = 'pastebin'
export default defineWebApplication({
setup() {
const { $gettext } = useGettext()
const userStore = useUserStore()

const routes = [
{
Expand Down Expand Up @@ -78,16 +80,19 @@ export default defineWebApplication({
]
}

const menuItems = computed<AppMenuItemExtension[]>(() => [
{
id: `app.${applicationId}.menuItem`,
type: 'appMenuItem',
label: () => $gettext('Pastebin'),
icon: 'upload',
path: urlJoin(applicationId),
color: 'white'
}
])
const menuItems = computed<AppMenuItemExtension[]>(() => {
if (!userStore.user) return []
return [
{
id: `app.${applicationId}.menuItem`,
type: 'appMenuItem',
label: () => $gettext('Pastebin'),
icon: 'upload',
path: urlJoin(applicationId),
color: 'white'
}
]
})

return {
appInfo,
Expand Down