fix: don't try to load the namespace again when navigating away from the settings page
Resolves https://github.com/go-vikunja/frontend/issues/58
This commit is contained in:
parent
9523a64bbb
commit
aadf75c7bf
2 changed files with 8 additions and 6 deletions
|
@ -217,6 +217,7 @@ const router = createRouter({
|
||||||
meta: {
|
meta: {
|
||||||
showAsModal: true,
|
showAsModal: true,
|
||||||
},
|
},
|
||||||
|
props: route => ({ namespaceId: parseInt(route.params.id as string) }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/namespaces/:namespaceId/settings/share',
|
path: '/namespaces/:namespaceId/settings/share',
|
||||||
|
|
|
@ -82,14 +82,16 @@ export default defineComponent({
|
||||||
Fancycheckbox,
|
Fancycheckbox,
|
||||||
editor: AsyncEditor,
|
editor: AsyncEditor,
|
||||||
},
|
},
|
||||||
beforeMount() {
|
props: {
|
||||||
this.namespace.id = this.$route.params.id
|
namespaceId: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// call again the method if the route changes
|
// call again the method if the route changes
|
||||||
'$route': {
|
namespaceId: {
|
||||||
handler: 'loadNamespace',
|
handler: 'loadNamespace',
|
||||||
deep: true,
|
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -103,8 +105,7 @@ export default defineComponent({
|
||||||
this.editorActive = false
|
this.editorActive = false
|
||||||
this.$nextTick(() => this.editorActive = true)
|
this.$nextTick(() => this.editorActive = true)
|
||||||
|
|
||||||
const namespace = new NamespaceModel({id: this.$route.params.id})
|
this.namespace = await this.namespaceService.get({id: this.namespaceId})
|
||||||
this.namespace = await this.namespaceService.get(namespace)
|
|
||||||
// This will trigger the dynamic loading of components once we actually have all the data to pass to them
|
// This will trigger the dynamic loading of components once we actually have all the data to pass to them
|
||||||
this.manageTeamsComponent = 'manageSharing'
|
this.manageTeamsComponent = 'manageSharing'
|
||||||
this.manageUsersComponent = 'manageSharing'
|
this.manageUsersComponent = 'manageSharing'
|
||||||
|
|
Loading…
Reference in a new issue