Skip to content

Commit 72e3a06

Browse files
committed
fix error handling
1 parent a981598 commit 72e3a06

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

src/renderer/src/Sources.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,7 @@ export const Sources = async (
443443
await forceDataChanges();
444444
console.log(`Forcing complete`);
445445
}
446-
logLoginAnalytics(tokenState.accessToken).catch((err) =>
447-
console.log('login analytics failed', err)
448-
);
446+
logLoginAnalytics(tokenState.accessToken);
449447
}
450448
const user = localStorage.getItem(LocalKey.userId) as string;
451449
setUser(user);
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import { axiosPost } from '../utils/axios';
22
export async function logLoginAnalytics(token?: string | null): Promise<void> {
3-
axiosPost('useranalytics/track', undefined, token as string)
4-
//.then((response) => {
5-
// console.log(
6-
// 'logLoginAnalytics',
7-
// (response as { data: { data: unknown } }).data?.data
8-
// );
9-
//})
10-
.catch((error) => {
11-
console.error('logLoginAnalytics', error);
12-
});
3+
if (!token) return;
4+
try {
5+
await axiosPost('useranalytics/track', undefined, token);
6+
} catch (error) {
7+
console.error('logLoginAnalytics', error);
8+
}
139
}

0 commit comments

Comments
 (0)