feat: default site name

This commit is contained in:
DIYgod 2022-06-30 22:34:02 +01:00
parent 9147576b04
commit a06132a7b1
No known key found for this signature in database
GPG Key ID: D159328F47A80DCA
1 changed files with 5 additions and 1 deletions

View File

@ -45,7 +45,10 @@ export const getUserSites = async (address: string) => {
platform: 'Ethereum',
});
const sites = profiles.list?.sort((a, b) => +new Date(b.date_updated || 0) - +new Date(a.date_updated || 0))
const sites = profiles.list?.sort((a, b) => +new Date(b.date_updated || 0) - +new Date(a.date_updated || 0)).map((profile) => {
profile.name = profile.name || profile.username;
return profile
})
if (!sites || !sites.length) return null
@ -64,6 +67,7 @@ export const getSite = async (input: string) => {
if (navigation) {
site.navigation = JSON.parse(navigation)
}
site.name = site.name || site.username
if (!site) return null