Skip to content

Commit

Permalink
🐜 fix request spamming when fetching problem list
Browse files Browse the repository at this point in the history
  • Loading branch information
Belikhun committed Mar 14, 2020
1 parent 50a7454 commit ed14629
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions assets/js/core.js
Expand Up @@ -915,13 +915,23 @@ const core = {

data = response.data;
} catch(e) {
if (e.data.code === 103) {
clog("WARN", "Kì thi chưa bắt đầu");
this.list.innerHTML = "";
} else
console.error(e);
switch (e.data.code) {
case 103:
clog("WARN", "Kì thi chưa bắt đầu");
this.list.innerHTML = "";
this.loaded = false;
break;
case 109:
clog("WARN", "Danh sách đề bài bị ẩn vì bạn chưa đăng nhập");
this.list.innerHTML = "";
this.loaded = true;
break;
default:
clog("ERRR", e);
this.loaded = false;
break;
}

this.loaded = false;
return false;
}

Expand Down

0 comments on commit ed14629

Please sign in to comment.