action:confirmed fix in leaving shared folder

This commit is contained in:
Čarodej
2021-11-04 10:45:27 +01:00
parent 29cb889283
commit 8d8fdbf9ba
4 changed files with 199 additions and 7 deletions

View File

@@ -105,7 +105,7 @@
left: 0;
right: 0;
bottom: 0;
z-index: 20;
z-index: 45;
overflow: auto;
height: 100%;
}

View File

@@ -200,7 +200,7 @@
events.$emit('popup:open', {name: 'create-folder'})
},
},
created() {
mounted() {
this.$store.commit('SET_CURRENT_TEAM_FOLDER', undefined)
this.$store.dispatch('getSharedWithMeFolder', this.$route.params.id)
@@ -214,7 +214,12 @@
if (data.operation === 'leave-team-folder')
axios.delete(`/api/teams/folders/${data.id}/leave`)
.then(() => {
this.$router.push({name: 'SharedWithMe'})
if (this.$route.params.id) {
this.$router.push({name: 'SharedWithMe'})
} else {
this.$store.dispatch('getSharedWithMeFolder', undefined)
}
events.$emit('toaster', {
type: 'success',
@@ -223,6 +228,9 @@
})
.catch(() => this.$isSomethingWrong())
})
},
beforeDestroy() {
events.$off('action:confirmed')
}
}
</script>

View File

@@ -230,7 +230,7 @@
events.$emit('popup:open', {name: 'create-folder'})
},
},
created() {
mounted() {
this.$store.dispatch('getTeamFolder', this.$route.params.id)
events.$on('context-menu:show', (event, item) => this.item = item)
@@ -255,6 +255,9 @@
})
.catch(() => this.$isSomethingWrong())
})
},
beforeDestroy() {
events.$off('action:confirmed')
}
}
</script>