Skip to content
This repository was archived by the owner on Dec 8, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/notifications/AppExplorer/AppCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const AppCard: React.FC<AppCardProps> = ({
userPubkey &&
activeSubscriptions.some(element => {
const projectURL = new URL(url)

return projectURL.hostname === element.metadata.appDomain
})
const logoURL = logo || '/fallback.svg'
Expand All @@ -74,6 +75,7 @@ const AppCard: React.FC<AppCardProps> = ({
appDomain: new URL(url).host
})
} catch (error) {
console.error(error)
setSubscribing(false)
showErrorMessageToast(`Failed to subscribe to ${name}`)
}
Expand Down
7 changes: 5 additions & 2 deletions src/contexts/W3iContext/hooks/notifyHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ export const useNotifyState = (w3iProxy: Web3InboxProxy, proxyReady: boolean) =>
})
}, [notifyClient, userPubkey, proxyReady])

// it takes time for handshake (watch subscriptions) to complete
// load in progress state using interval until it is
/*
* It takes time for handshake (watch subscriptions) to complete
* load in progress state using interval until it is
*/
useEffect(() => {
if (notifyClient?.hasFinishedInitialLoad()) {
setWatchSubscriptionsComplete(true)
Expand All @@ -74,6 +76,7 @@ export const useNotifyState = (w3iProxy: Web3InboxProxy, proxyReady: boolean) =>
setRegistered(identityKey)
refreshNotifyState()
} catch (error) {
console.error(error)
setRegisterMessage(null)
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/widget/Subscribe/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const WidgetSubscribe: React.FC = () => {
appDomain: new URL(dappOrigin).host
})
} catch (error) {
showErrorMessageToast('Failed to subscribe')
console.error(error)
showErrorMessageToast(`Failed to subscribe to ${dappOrigin}`)
} finally {
setIsSubscribing(false)
}
Expand Down
7 changes: 4 additions & 3 deletions src/utils/hooks/useNotifyProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,20 @@ const useNotifyProjects = () => {
url: item.dapp_url,
icon: item.image_url?.md ?? '/fallback.svg',
colors: item.metadata?.colors,
isVerified: item.is_verified || item.isVerified ? true : false,
isVerified: Boolean(item.is_verified || item.isVerified),
isFeatured: item.is_featured,
isComingSoon: item.is_coming_soon
}))
.filter(app => Boolean(app.name))

notifyApps.concat(COMING_SOON_PROJECTS)

setLoading(false)
setProjects(notifyApps)
} catch (error) {
setLoading(false)
console.error(error)
setProjects([])
} finally {
setLoading(false)
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/utils/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ export async function fetchFeaturedProjects<T>() {

try {
const discoverProjectsData = await fetch(explorerUrlFeatured)
.then(res => res.json())
.catch(err => console.log({ featuredProjects: err }))
.then(async res => res.json())
.catch(err => console.error({ featuredProjects: err }))
const discoverProjects = Object.values(discoverProjectsData.projects)

return {
data: discoverProjects as T
}
} catch (error) {
throw new Error('Error fetching featured projects')
throw new Error(`Error fetching featured projects: ${error}`)
}
}

Expand All @@ -35,13 +35,13 @@ export async function fetchDomainProjects<T>(domain: string) {
explorerUrlAppDomain.searchParams.set('appDomain', domain)

try {
const domainProjectsData = await fetch(explorerUrlAppDomain).then(res => res.json())
const domainProjectsData = await fetch(explorerUrlAppDomain).then(async res => res.json())
domainProject = domainProjectsData.data as T

return {
data: domainProject
}
} catch (error) {
throw new Error('Error fetching domain project')
throw new Error(`Error fetching projects for domain: ${error}`)
}
}