alpha
Login
or
Join now
dunkirk.sh
/
smokie
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
bug: fix no hackatime account issues
author
Kieran Klukas
date
1 year ago
(Apr 25, 2025, 8:09 PM -0400)
commit
d44cf66a
d44cf66adadb855ab861463d39ea20fd5fd39a19
parent
94af4047
94af4047492f3ffd32f0ee7119d4820bd0bffa86
+56
-33
2 changed files
Expand all
Collapse all
Unified
Split
src
features
takes
handlers
settings.ts
libs
hackatime.ts
+43
-33
src/features/takes/handlers/settings.ts
Reviewed
···
59
59
}
60
60
}
61
61
62
62
+
const hackatimeKeys = await fetchRecentProjectKeys(
63
63
+
user,
64
64
+
10,
65
65
+
initialValues.hackatime_version as HackatimeVersion,
66
66
+
);
67
67
+
62
68
await slackClient.views.open({
63
69
trigger_id: triggerID,
64
70
view: {
···
185
191
})),
186
192
},
187
193
},
188
188
-
{
189
189
-
type: "input",
190
190
-
block_id: "project_keys",
191
191
-
label: {
192
192
-
type: "plain_text",
193
193
-
text: "Project Keys",
194
194
-
},
195
195
-
element: {
196
196
-
type: "multi_static_select",
197
197
-
action_id: "project_keys_input",
198
198
-
initial_options:
199
199
-
initialValues.hackatime_keys.length === 0
200
200
-
? undefined
201
201
-
: initialValues.hackatime_keys.map((key) => ({
202
202
-
text: {
203
203
-
type: "plain_text",
204
204
-
text: key,
205
205
-
},
206
206
-
value: key,
207
207
-
})),
208
208
-
options: (
209
209
-
await fetchRecentProjectKeys(
210
210
-
user,
211
211
-
10,
212
212
-
initialValues.hackatime_version as HackatimeVersion,
213
213
-
)
214
214
-
).map((key) => ({
215
215
-
text: {
194
194
+
hackatimeKeys.length > 0
195
195
+
? {
196
196
+
type: "input",
197
197
+
block_id: "project_keys",
198
198
+
label: {
216
199
type: "plain_text",
217
217
-
text: key,
200
200
+
text: "Project Keys",
218
201
},
219
219
-
value: key,
220
220
-
})),
221
221
-
},
222
222
-
},
202
202
+
element: {
203
203
+
type: "multi_static_select",
204
204
+
action_id: "project_keys_input",
205
205
+
initial_options:
206
206
+
initialValues.hackatime_keys.length === 0
207
207
+
? undefined
208
208
+
: initialValues.hackatime_keys.map(
209
209
+
(key) => ({
210
210
+
text: {
211
211
+
type: "plain_text",
212
212
+
text: key,
213
213
+
},
214
214
+
value: key,
215
215
+
}),
216
216
+
),
217
217
+
options: hackatimeKeys.map((key) => ({
218
218
+
text: {
219
219
+
type: "plain_text",
220
220
+
text: key,
221
221
+
},
222
222
+
value: key,
223
223
+
})),
224
224
+
},
225
225
+
}
226
226
+
: {
227
227
+
type: "section",
228
228
+
text: {
229
229
+
text: "You don't have any hackatime projects. Go setup hackatime with `/hackatime`",
230
230
+
type: "mrkdwn",
231
231
+
},
232
232
+
},
223
233
],
224
234
},
225
235
});
+13
src/libs/hackatime.ts
Reviewed
···
124
124
});
125
125
126
126
if (!response.ok) {
127
127
+
if (response.status === 401) {
128
128
+
// Return blank info for 401 Unauthorized errors
129
129
+
return {
130
130
+
categories: [],
131
131
+
projects: [],
132
132
+
languages: [],
133
133
+
editors: [],
134
134
+
operating_systems: [],
135
135
+
total_categories_sum: 0,
136
136
+
total_categories_human_readable: "0h 0m 0s",
137
137
+
projectsKeys: [],
138
138
+
};
139
139
+
}
127
140
throw new Error(
128
141
`Failed to fetch Hackatime summary: ${response.status} ${response.statusText}: ${await response.text()}`,
129
142
);