Skip to content

Commit

Permalink
fix: handle organisation name issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sunithvs committed Dec 30, 2024
1 parent 36b4769 commit 208e462
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@

async function resolveProfileUrl() {
const pathParts = window.location.pathname.split('/').filter(part => part);
// const username = pathParts[0];
const username = pathParts[0];
// const username = 'sunithvs'

if (!username || !isValidGitHubUsername(username)) {
return '';
Expand Down Expand Up @@ -363,6 +363,7 @@

throw new Error('Failed to fetch profile data');
}
// if error in response

return await response.json();
} catch (error) {
Expand Down Expand Up @@ -412,9 +413,11 @@ <h1 class="text-4xl font-bold text-red-600 mb-4">Oops! Something went wrong</h1>

document.addEventListener('DOMContentLoaded', async () => {
const profile = await fetchUserProfile();
console.log(profile)
if ('error' in profile) {
renderErrorPage(new Error(profile.error));
}
if (!profile) {
return;
renderErrorPage(new Error('Failed to fetch profile data'));
}
renderProfile(profile);
document.title = profile.name + ' - devb.io Developer Profile';
Expand Down

0 comments on commit 208e462

Please sign in to comment.