Skip to content

Commit

Permalink
style: warning ui
Browse files Browse the repository at this point in the history
  • Loading branch information
kjinengineer committed Nov 5, 2024
1 parent 7e63ab9 commit da68412
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 4 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
value='${localStorage.getItem("fontSize") || 12}'
/>
</div>
<div class="warning"><div class="warningBox">hello</div></div>
<div class="warning">
Warning: Circular Deps
<div class="warningBox"></div>
</div>
</div>
</div>
<script type="module" src="./graph.js"></script>
Expand Down
2 changes: 0 additions & 2 deletions src/utils/depUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,9 @@ export function removeDuplicateCircularDeps(
const result: [string, string][] = [];

dependencies.forEach((pair) => {
// 각 쌍을 정렬하여 중복 체크 가능하게 만듦
const sortedPair = pair.slice().sort();
const key = `${sortedPair[0]}-${sortedPair[1]}`;

// 이미 존재하지 않는 경우에만 추가
if (!uniqueDeps.has(key)) {
uniqueDeps.add(key);
result.push(pair);
Expand Down
5 changes: 1 addition & 4 deletions src/warningBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ function showAlert(message) {
const warning = document.querySelector(".warning") as HTMLElement;
const warningBox = document.querySelector(".warningBox");

if (warningBox instanceof HTMLElement) {
warning.style.display = "inline-block";
}

warning.style.display = "inline-block";
warningBox.innerHTML = message.map((pair) => pair.join(" ⇄ ")).join("<br>");
}

0 comments on commit da68412

Please sign in to comment.