@@ -61,7 +61,7 @@ export class WidgetService {
61
61
this . apiService . getActivity ( process . env . ACTIVITY_API , process . env . ACTIVITY_ID )
62
62
] ) ;
63
63
64
- const top_repos = github_data . data . user ?. repositories ?. nodes ?. slice ( 0 , 3 ) ?. reduce ( ( acc , value ) => {
64
+ const top_repos = github_data . data . user ?. repositories ?. nodes ?. reduce ( ( acc , value ) => {
65
65
const el = { [ value . name ] : value . stargazerCount } ;
66
66
acc = { ...acc , ...el } ;
67
67
return acc ;
@@ -74,16 +74,16 @@ export class WidgetService {
74
74
} , { } ) ;
75
75
76
76
json = {
77
- name : github_data . data . user ?. name ?? 'n/a' ,
77
+ name : github_data . data . user ?. name ?? null ,
78
78
description : process . env . DESCRIPTION ,
79
79
github : {
80
- followers : github_data . data . user ?. followers ?. totalCount ,
81
- total_stars : github_data . data . user ?. repositories ?. totalCount ,
82
- top_repos : top_repos ,
80
+ followers : github_data . data . user ?. followers ?. totalCount ?? null ,
81
+ total_stars : github_data . data . user ?. repositories ?. totalCount ?? null ,
82
+ top_repos : top_repos ?? null ,
83
83
streak : streak ? {
84
84
current : streak . streak ,
85
85
longest : streak . longest
86
- } : undefined ,
86
+ } : null ,
87
87
} ,
88
88
wakatime : {
89
89
all_time : wakatime_global ?. data ?. grand_total ?. human_readable_total_including_other_language ,
@@ -92,7 +92,7 @@ export class WidgetService {
92
92
weather : weather ? {
93
93
temperature : weather . temp ,
94
94
condition : weather . condition
95
- } : undefined ,
95
+ } : null ,
96
96
datetime : {
97
97
time : this . getTime ( ) ,
98
98
tz : process . env . DATETIME_TIMEZONE ,
@@ -102,7 +102,7 @@ export class WidgetService {
102
102
file : activity . activities [ 0 ] . file ?? 'Idling' ,
103
103
workplace : activity . activities [ 0 ] . workplace ?? 'No workplace' ,
104
104
duration : this . getTimeDiff ( new Date ( activity . activities [ 0 ] . start_time ) )
105
- } : undefined ,
105
+ } : null ,
106
106
created_by : "AndcoolSystems"
107
107
}
108
108
} catch ( e ) {
0 commit comments