@@ -85,8 +85,8 @@ const initUI = () => {
85
85
insertLocation = insertLocation . previousElementSibling
86
86
}
87
87
88
- const btnGroup = document . createElement ( 'div' )
89
- btnGroup . className = 'BtnGroup mt-1 ml-3 position-relative top-0 float-right'
88
+ const buttonGroup = document . createElement ( 'div' )
89
+ buttonGroup . className = 'BtnGroup mt-1 ml-3 position-relative top-0 float-right'
90
90
91
91
const squaresButton = document . createElement ( 'button' )
92
92
squaresButton . innerHTML = '2D'
@@ -106,9 +106,9 @@ const initUI = () => {
106
106
cubesButton . classList . add ( 'selected' )
107
107
}
108
108
109
- btnGroup . append ( squaresButton )
110
- btnGroup . append ( cubesButton )
111
- insertLocation . before ( btnGroup )
109
+ buttonGroup . append ( squaresButton )
110
+ buttonGroup . append ( cubesButton )
111
+ insertLocation . before ( buttonGroup )
112
112
113
113
setContainerViewType ( toggleSetting )
114
114
}
@@ -283,9 +283,7 @@ const loadStats = () => {
283
283
284
284
// Best day
285
285
dateBest = dateFormat . format ( bestDay )
286
- if ( ! dateBest ) {
287
- dateBest = 'No activity found'
288
- }
286
+ dateBest ||= 'No activity found'
289
287
290
288
// Longest streak
291
289
if ( streakLongest > 0 ) {
@@ -303,8 +301,8 @@ const loadStats = () => {
303
301
}
304
302
305
303
const rgbToHex = ( rgb ) => {
306
- const sep = rgb . includes ( ',' ) ? ',' : ' '
307
- rgb = rgb . slice ( 4 ) . split ( ')' ) [ 0 ] . split ( sep )
304
+ const separator = rgb . includes ( ',' ) ? ',' : ' '
305
+ rgb = rgb . slice ( 4 ) . split ( ')' ) [ 0 ] . split ( separator )
308
306
309
307
let r = Number ( rgb [ 0 ] ) . toString ( 16 )
310
308
let g = Number ( rgb [ 1 ] ) . toString ( 16 )
0 commit comments