From 5e208ea10c95521273f33d62b3a41305dc2fbb2f Mon Sep 17 00:00:00 2001
From: Leah Tacke genannt Unterberg <leah.tgu@pads.rwth-aachen.de>
Date: Tue, 10 Dec 2024 13:35:47 +0100
Subject: [PATCH] minor fix

---
 src/components/SetupView.vue | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/components/SetupView.vue b/src/components/SetupView.vue
index e95933e..274841d 100644
--- a/src/components/SetupView.vue
+++ b/src/components/SetupView.vue
@@ -22,8 +22,8 @@ const dbUploadForm = reactive({file: null, is_valid: false})
 const dbConnForm = reactive({url: '', is_valid: false})
 
 function initFromState() {
-  if(store.sessionReady) return 3
-  else if(store.sessionCreated) return 2
+  if (store.sessionReady) return 3
+  else if (store.sessionCreated) return 2
   else return 1
 }
 
@@ -36,13 +36,15 @@ async function startSessionAction() {
 }
 
 async function uploadAction() {
-  loading.value = true
-  await api.uploadDB(dbUploadForm.file).then(res => {
-    if (res) {
-      console.log('File uploaded:', res)
-      step.value = 3
-    }
-  }).finally(() => loading.value = false)
+  if (!!dbUploadForm.file) {
+    loading.value = true
+    await api.uploadDB(dbUploadForm.file).then(res => {
+      if (res) {
+        console.log('File uploaded:', res)
+        step.value = 3
+      }
+    }).finally(() => loading.value = false)
+  }
 }
 
 async function connectAction() {
-- 
GitLab