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>
<script setup>
import TaskDetailView from './TaskDetailView'
import router from '@/router'
import {computed} from 'vue'
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() {
router.back()
if (historyState.value) {
router.back()
} else {
const backdropRoute = historyState.value?.backdropView && router.resolve(historyState.value.backdropView)
router.push(backdropRoute)
}
}
</script>