From a153c489bc489c95dca949139326cf9973ea6a23 Mon Sep 17 00:00:00 2001 From: MissterHao Date: Fri, 21 May 2021 12:33:03 +0800 Subject: [PATCH] feat: v1.0.0 released --- package.json | 2 +- renderer/CourseSelWorker.html | 39 +++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 434c604..4dc44d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wannaclass", - "version": "0.9.1", + "version": "1.0.0", "description": "Get class from yzu course api.", "main": "app.js", "scripts": { diff --git a/renderer/CourseSelWorker.html b/renderer/CourseSelWorker.html index b677d38..24efa03 100644 --- a/renderer/CourseSelWorker.html +++ b/renderer/CourseSelWorker.html @@ -103,24 +103,27 @@ } rows.forEach((element) => { console.log(element); - apibackend.selCourseInline(element).then((res) => { - console.log(res); - if (res["data"] === "選課系統尚未開放!") { - // setStatus(element.id, Math.floor(Math.random() * 10)) - setStatus(element.id, 0) - } else if (res["data"].indexOf("已選過")) { - // 2 => 已選過 - setStatus(element.id, 2) - } else if (res["data"].indexOf("加選訊息")) { - // 1 => 已選 任務完成 - setStatus(element.id, 1) - } else { - // -9999 其他未知訊息 - setStatus(element.id, -9999) - } - }).catch((error) => { - console.error(error) - }) + + if(element.status!=2 || element.status!=3){ + apibackend.selCourseInline(element).then((res) => { + console.log(res); + if (res["data"] === "選課系統尚未開放!") { + // setStatus(element.id, Math.floor(Math.random() * 10)) + setStatus(element.id, 0) + } else if (res["data"].indexOf("已選過")) { + // 2 => 已選過 + setStatus(element.id, 2) + } else if (res["data"].indexOf("加選訊息")) { + // 1 => 已選 任務完成 + setStatus(element.id, 1) + } else { + // -9999 其他未知訊息 + setStatus(element.id, -9999) + } + }).catch((error) => { + console.error(error) + }) + } }); }); }