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: {
|
||||
showAsModal: true,
|
||||
},
|
||||
props: route => ({ namespaceId: parseInt(route.params.id as string) }),
|
||||
},
|
||||
{
|
||||
path: '/namespaces/:namespaceId/settings/share',
|
||||
|
|
|
@ -82,14 +82,16 @@ export default defineComponent({
|
|||
Fancycheckbox,
|
||||
editor: AsyncEditor,
|
||||
},
|
||||
beforeMount() {
|
||||
this.namespace.id = this.$route.params.id
|
||||
props: {
|
||||
namespaceId: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
// call again the method if the route changes
|
||||
'$route': {
|
||||
namespaceId: {
|
||||
handler: 'loadNamespace',
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
|
@ -103,8 +105,7 @@ export default defineComponent({
|
|||
this.editorActive = false
|
||||
this.$nextTick(() => this.editorActive = true)
|
||||
|
||||
const namespace = new NamespaceModel({id: this.$route.params.id})
|
||||
this.namespace = await this.namespaceService.get(namespace)
|
||||
this.namespace = await this.namespaceService.get({id: this.namespaceId})
|
||||
// This will trigger the dynamic loading of components once we actually have all the data to pass to them
|
||||
this.manageTeamsComponent = 'manageSharing'
|
||||
this.manageUsersComponent = 'manageSharing'
|
||||
|
|
Loading…
Reference in a new issue