From ebfc9daacd6f138a3fc610bd13661fec7867f48c Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 6 May 2025 10:17:04 +0200 Subject: [PATCH] fix(VnUserLink): initialize isWorker to false and simplify error handling --- src/components/ui/VnUserLink.vue | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/ui/VnUserLink.vue b/src/components/ui/VnUserLink.vue index ec3811505..9a25852b3 100644 --- a/src/components/ui/VnUserLink.vue +++ b/src/components/ui/VnUserLink.vue @@ -9,7 +9,7 @@ const $props = defineProps({ workerId: { type: Number, default: null }, defaultName: { type: Boolean, default: false }, }); -const isWorker = ref(); +const isWorker = ref(false); onMounted(async () => { try { @@ -18,10 +18,7 @@ onMounted(async () => { } = await axios(`/Workers/${$props.workerId}/exists`); isWorker.value = exists; } catch (error) { - if (error.status === 403) { - isWorker.value = false; - return; - } + if (error.status === 403) return; throw error; } });