Skip to content

Commit 2bc60d9

Browse files
committed
feat: show error toast when token is missing or invalid
1 parent 41d5c7b commit 2bc60d9

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,15 @@ export const plugin: Plugin = async (ctx) => {
252252
"CODETIME_TOKEN not set. CodeTime tracking disabled. " +
253253
"Get your token from https://codetime.dev/dashboard/settings",
254254
).catch(() => {});
255+
try {
256+
await (client as any).tui.showToast({
257+
body: {
258+
title: "CodeTime",
259+
message: "CODETIME_TOKEN not set. Tracking disabled.",
260+
variant: "error",
261+
},
262+
});
263+
} catch {}
255264
return {};
256265
}
257266

@@ -261,6 +270,15 @@ export const plugin: Plugin = async (ctx) => {
261270
await error(
262271
"Invalid CODETIME_TOKEN. Please check your token at https://codetime.dev/dashboard/settings",
263272
).catch(() => {});
273+
try {
274+
await (client as any).tui.showToast({
275+
body: {
276+
title: "CodeTime",
277+
message: "Invalid token. Check https://codetime.dev/dashboard/settings",
278+
variant: "error",
279+
},
280+
});
281+
} catch {}
264282
_token = null;
265283
return {};
266284
}

0 commit comments

Comments
 (0)