fix: closing modal

This commit is contained in:
Dominik Pschenitschni 2021-12-07 19:23:27 +01:00
parent e837621ef8
commit e54d95802b
No known key found for this signature in database
GPG key ID: B257AC0149F43A77

View file

@ -12,11 +12,22 @@
</template> </template>
<script setup> <script setup>
import TaskDetailView from './TaskDetailView' import {computed} from 'vue'
import router from '@/router' import {useRouter, useRoute} from 'vue-router'
import TaskDetailView from './TaskDetailView'
const route = useRoute()
const historyState = computed(() => route.fullPath && window.history.state)
const router = useRouter()
function close() { function close() {
router.back() if (historyState.value) {
router.back()
} else {
const backdropRoute = historyState.value?.backdropView && router.resolve(historyState.value.backdropView)
router.push(backdropRoute)
}
} }
</script> </script>