Skip to content

Commit

Permalink
fix: Update icons properly in the navigation and heading
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Mar 14, 2024
1 parent 36c15a4 commit 2da88c4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/modules/modals/EditContext.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<NcIconPicker :close-on-select="true" @select="setIcon">
<NcButton
type="tertiary"
:aria-label="t('tables', 'Select an icon for applcation')"
:aria-label="t('tables', 'Select an icon for application')"
:title="t('tables', 'Select icon')"
@click.prevent>
<template #icon>
Expand Down Expand Up @@ -110,15 +110,12 @@ export default {
if (this.contextId) {
const context = this.getContext(this.contextId)
this.title = context.name
this.icon.name = context.iconName
this.setIcon(this.localContext.iconName)
this.description = context.description
this.resources = context ? [...this.getContextResources(context)] : []
}
},
},
async mounted() {
await this.setIcon('equalizer')
},
methods: {
async setIcon(iconName) {
this.icon.name = iconName
Expand Down
9 changes: 7 additions & 2 deletions src/modules/navigation/partials/NavigationContextItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ export default {
...mapGetters(['activeContext']),
},
async mounted() {
this.icon = await this.getContextIcon(this.context.iconName)
watch: {
'context.iconName': {
async handler() {
this.icon = await this.getContextIcon(this.context.iconName)
},
immediate: true,
},
},
methods: {
Expand Down
6 changes: 6 additions & 0 deletions src/pages/Context.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ export default {
await this.reload()
}
},
'context.iconName': {
async handler(value) {
this.icon = value ? await this.getContextIcon(value) : ''
},
immediate: true,
},
},
async mounted() {
Expand Down

0 comments on commit 2da88c4

Please sign in to comment.