Forráskód Böngészése

modified Upload.vue

tomoya 1 éve
szülő
commit
7fa51da4c3
1 módosított fájl, 13 hozzáadás és 10 törlés
  1. 13 10
      frontend/src/views/main/Upload.vue

+ 13 - 10
frontend/src/views/main/Upload.vue

@@ -6,7 +6,8 @@ import { useI18n } from "vue-i18n";
 import { wsUrl } from "@/env";
 import type { VideoCreate } from "@/interfaces";
 import type { VideoUploaded } from "@/interfaces";
-
+import router from "@/router";
+import Dialog from "@/components/Dialog.vue";
 
 const { t } = useI18n();
 const mainStore = useMainStore();
@@ -167,13 +168,12 @@ const getImageUrl = (imgFolder: string, name: string) => {
     .href;
 };
 
-// watch(dialog, (newVal, oldVal) => {
-//   if (!newVal.show) {
-//     setTimeout(() => {
-//       router.push("/main/progress");
-//     }, 1000);
-//   }
-// });
+watch(dialog, (newVal, oldVal) => {
+  if (!newVal.show) {
+    console.log('show false')
+    router.push("/main/progress");
+  }
+});
 
 async function Submit() {
   WS.send("subscribe");
@@ -197,6 +197,9 @@ async function Submit() {
     else {
       dialog.msg = ret.error_message!
     }
+    setTimeout(() => {
+    dialog.show = true;
+  }, 2000);
     valid.value = true;
     (Form as any).value.reset();
   }
@@ -384,7 +387,7 @@ async function Submit() {
       </v-card-text>
     </v-card>
 
-    <!-- <template>
+    <template>
       <div class="text-center">
         <Dialog
           :msg="dialog.msg"
@@ -393,7 +396,7 @@ async function Submit() {
           @close="dialog.show = false"
         ></Dialog>
       </div>
-    </template> -->
+    </template>
   </v-container>
 </template>