Skip to content

Commit

Permalink
Merge pull request #26 from Aoki-Dai/main
Browse files Browse the repository at this point in the history
wip
  • Loading branch information
leviosa42 authored Aug 4, 2024
2 parents 0110d4c + 922b6d2 commit b3c0058
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,28 @@ const checkAchivementIsCompleted = async () => {

// 完了済みのToDoをカウント
const countCompletedTodo = () => {
let countCompleted = 0;
const text = document.getElementById("js-count-completed");
const progressCircle = document.getElementById("js-progress-circle");
const progressText = document.getElementById("js-progress-text");
const itemsJSON = todoStorage.loadTodoItems();
const totalTasks = itemsJSON.length; // totalTasksを設定
//const totalTasks = itemsJSON.length; // totalTasksを設定

// 初期化
let countCompleted = 0;
let totalTasks = 0;

// (not 完了された) and (削除された) ToDoを除外
//const totalTasks = itemsJSON.filter((item) => !item.isCompleted && !item.isRemoved).length;

if (itemsJSON) {
itemsJSON.forEach((item) => {
// return item.isCompleted || !item.isRemoved;
// }).length;

// countCompleted = itemsJSON.filter((item) => item.isCompleted).length;
if (!item.isCompleted && !item.isRemoved) {
totalTasks++;
}
if (item.isCompleted) {
countCompleted++;
}
Expand Down

0 comments on commit b3c0058

Please # to comment.