Skip to content

Commit

Permalink
fix: 동시에 여러 언론사 구독시 애니메이션이 리셋되는 문제 해결 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
seokhun authored and seokhun committed Jul 21, 2023
1 parent 6c26dbf commit d217302
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/controller/subscribeController.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ function toggleSubscribe(src) {
const targetNews = findTargetNewsFromSrc(src);
targetNews.is_subscribe = targetNews.is_subscribe === "true" ? "false" : "true";

if (GLOBAL.SNACKBAR_TIME_OUT !== null) {
document.querySelector(".snack-bar").style.display = "none";
window.clearTimeout(GLOBAL.SNACKBAR_TIME_OUT);
GLOBAL.SNACKBAR_TIME_OUT = null;
}

if (targetNews.is_subscribe === "true") {
GLOBAL.SUBSCRIBE_NEWS_DATA.push(targetNews);
GLOBAL.SUBSCRIBE_NEWS_NUM++;
Expand All @@ -62,12 +68,6 @@ function toggleSubscribe(src) {
}
}

if (GLOBAL.SNACKBAR_TIME_OUT !== null) {
document.querySelector(".snack-bar").style.display = "none";
window.clearTimeout(GLOBAL.SNACKBAR_TIME_OUT);
GLOBAL.SNACKBAR_TIME_OUT = null;
}

changeState(STATE.UNSUBSCRIBE_NEWS);
}
}
Expand Down

0 comments on commit d217302

Please sign in to comment.