Skip to content

Commit e03fa2d

Browse files
committed
days was already defined
1 parent 29b5bc1 commit e03fa2d

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/iso.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -167,26 +167,28 @@ const loadStats = () => {
167167
let currentStreakStart = null
168168
let currentStreakEnd = null
169169

170-
const days = [...document.querySelectorAll('.js-calendar-graph-table tbody td.ContributionCalendar-day')].map((d) => {
171-
return {
172-
date: new Date(d.dataset.date),
173-
week: d.dataset.ix,
174-
color: getSquareColor(d),
175-
tid: d.getAttribute('aria-labelledby')
170+
const dayNodes = [...document.querySelectorAll('.js-calendar-graph-table tbody td.ContributionCalendar-day')].map(
171+
(d) => {
172+
return {
173+
date: new Date(d.dataset.date),
174+
week: d.dataset.ix,
175+
color: getSquareColor(d),
176+
tid: d.getAttribute('aria-labelledby')
177+
}
176178
}
177-
})
179+
)
178180

179-
const tooltips = [...document.querySelectorAll('.js-calendar-graph tool-tip')].map((t) => {
181+
const tooltipNodes = [...document.querySelectorAll('.js-calendar-graph tool-tip')].map((t) => {
180182
return {
181183
tid: t.id,
182184
count: getCountFromNode(t)
183185
}
184186
})
185187

186-
const data = days.map((d) => {
188+
const data = dayNodes.map((d) => {
187189
return {
188190
...d,
189-
...(tooltips.find((t) => t.tid === d.tid) || {})
191+
...tooltipNodes.find((t) => t.tid === d.tid)
190192
}
191193
})
192194

0 commit comments

Comments
 (0)