diff --git a/src/modules/modals/CreateContext.vue b/src/modules/modals/CreateContext.vue index 63fb291ed..fa5960675 100644 --- a/src/modules/modals/CreateContext.vue +++ b/src/modules/modals/CreateContext.vue @@ -67,6 +67,7 @@ export default { NcIconSvgWrapper, NcContextResource, }, + mixins: [svgHelper], props: { showModal: { type: Boolean, @@ -87,10 +88,6 @@ export default { resources: [], } }, - async mounted() { - await this.setIcon('equalizer') - }, - mixins: [svgHelper], watch: { title() { if (this.title.length >= 200) { @@ -99,6 +96,9 @@ export default { } }, }, + async mounted() { + await this.setIcon('equalizer') + }, methods: { titleChangedManually() { this.customTitleChosen = true diff --git a/src/modules/modals/EditContext.vue b/src/modules/modals/EditContext.vue index 3a5a3b72d..a87cca82d 100644 --- a/src/modules/modals/EditContext.vue +++ b/src/modules/modals/EditContext.vue @@ -69,6 +69,7 @@ export default { NcIconSvgWrapper, NcContextResource, }, + mixins: [svgHelper], props: { showModal: { type: Boolean, @@ -91,10 +92,6 @@ export default { resources: [], } }, - async mounted() { - await this.setIcon('equalizer') - }, - mixins: [svgHelper], computed: { ...mapGetters(['getContext']), ...mapState(['tables', 'views']), @@ -119,6 +116,9 @@ export default { } }, }, + async mounted() { + await this.setIcon('equalizer') + }, methods: { async setIcon(iconName) { this.icon.name = iconName diff --git a/src/modules/navigation/partials/NavigationContextItem.vue b/src/modules/navigation/partials/NavigationContextItem.vue index 08f13ceef..96e2ddb91 100644 --- a/src/modules/navigation/partials/NavigationContextItem.vue +++ b/src/modules/navigation/partials/NavigationContextItem.vue @@ -55,14 +55,14 @@ export default { icon: null, } }, + computed: { + ...mapGetters(['activeContext']), + }, async mounted() { this.icon = await this.getContextIcon(this.context.iconName) }, - computed: { - ...mapGetters(['activeContext']), - }, methods: { emit, async editContext() { diff --git a/src/modules/navigation/sections/Navigation.vue b/src/modules/navigation/sections/Navigation.vue index 9b32da94d..da5618c41 100644 --- a/src/modules/navigation/sections/Navigation.vue +++ b/src/modules/navigation/sections/Navigation.vue @@ -108,8 +108,6 @@ import Magnify from 'vue-material-design-icons/Magnify.vue' import Archive from 'vue-material-design-icons/Archive.vue' import { getCurrentUser } from '@nextcloud/auth' -import NcIconPicker from '../../../shared/components/ncIconPicker/NcIconPicker.vue' - export default { name: 'Navigation', components: { @@ -126,8 +124,6 @@ export default { NcButton, NcCounterBubble, NcEmptyContent, - - NcIconPicker, }, data() { return { diff --git a/src/pages/Context.vue b/src/pages/Context.vue index 94aadb068..155eba095 100644 --- a/src/pages/Context.vue +++ b/src/pages/Context.vue @@ -5,7 +5,7 @@

-   {{ activeContext.name }} +   {{ activeContext.name }}

diff --git a/src/shared/components/ncIconPicker/NcIconPicker.vue b/src/shared/components/ncIconPicker/NcIconPicker.vue index abcd517c9..eb2c03a8a 100644 --- a/src/shared/components/ncIconPicker/NcIconPicker.vue +++ b/src/shared/components/ncIconPicker/NcIconPicker.vue @@ -1,52 +1,51 @@ diff --git a/src/shared/components/ncIconPicker/mixins/svgHelper.js b/src/shared/components/ncIconPicker/mixins/svgHelper.js index 34cdb416e..c6c7e3e46 100644 --- a/src/shared/components/ncIconPicker/mixins/svgHelper.js +++ b/src/shared/components/ncIconPicker/mixins/svgHelper.js @@ -1,15 +1,15 @@ export default { - methods: { - uriToSvg(dataUri) { - const pattern = /data:image\/svg\+xml;base64,/ - const strippedUri = dataUri.replace(pattern, '') + methods: { + uriToSvg(dataUri) { + const pattern = /data:image\/svg\+xml;base64,/ + const strippedUri = dataUri.replace(pattern, '') - return atob(strippedUri) - }, - async getContextIcon(iconName) { - const { default: icon } = await import(`@mdi/svg/svg/${iconName}.svg`) + return atob(strippedUri) + }, + async getContextIcon(iconName) { + const { default: icon } = await import(`@mdi/svg/svg/${iconName}.svg`) - return this.uriToSvg(icon) - } - } + return this.uriToSvg(icon) + }, + }, } diff --git a/src/shared/components/ncIconPicker/partials/Icon.vue b/src/shared/components/ncIconPicker/partials/Icon.vue index fe18ecc8f..2cb1ed717 100644 --- a/src/shared/components/ncIconPicker/partials/Icon.vue +++ b/src/shared/components/ncIconPicker/partials/Icon.vue @@ -1,13 +1,16 @@ diff --git a/src/shared/components/ncIconPicker/partials/IconPicker.vue b/src/shared/components/ncIconPicker/partials/IconPicker.vue index 8f3a2da54..1f94e2ac7 100644 --- a/src/shared/components/ncIconPicker/partials/IconPicker.vue +++ b/src/shared/components/ncIconPicker/partials/IconPicker.vue @@ -1,51 +1,49 @@