fixed error when opening application from recruiter view when sidepanel is closed
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
TableRow,
|
||||
} from '@/components/ui/table'
|
||||
import Button from '@/components/ui/button/Button.vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { CheckIcon, XIcon } from 'lucide-vue-next';
|
||||
import Application from './Application.vue';
|
||||
@@ -54,24 +54,24 @@ function formatExact(iso) {
|
||||
|
||||
const router = useRouter();
|
||||
function openApplication(id) {
|
||||
if (!id) return;
|
||||
router.push(`/administration/applications/${id}`)
|
||||
openPanel.value = true;
|
||||
}
|
||||
|
||||
function closeApplication() {
|
||||
router.push('/administration/applications')
|
||||
openPanel.value = false;
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
watch(() => route.params.id, (newId) => {
|
||||
if (newId === undefined) {
|
||||
openPanel.value = false;
|
||||
}
|
||||
})
|
||||
|
||||
const openPanel = ref(false);
|
||||
// const openPanel = ref(false);
|
||||
const openPanel = computed(() => route.params.id !== undefined)
|
||||
|
||||
|
||||
onMounted(async () => {
|
||||
appList.value = await getAllApplications();
|
||||
|
||||
Reference in New Issue
Block a user