fix(VnUserLink): initialize isWorker to false and simplify error handling
gitea/salix-front/pipeline/pr-master There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-master There was a failure building this commit
Details
This commit is contained in:
parent
8f1533d496
commit
ebfc9daacd
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue