feat: home optimization - prevent avatars and banners rerendering
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import { SiteNavigationItem, Profile } from "~/lib/types"
|
||||
import { nanoid } from "nanoid"
|
||||
import { checkReservedWords } from "~/lib/reserved-words"
|
||||
import unidata from "~/lib/unidata"
|
||||
import { indexer, getContract } from "~/lib/crossbell"
|
||||
import { renderPageContent } from "~/markdown"
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
|
||||
export const checkSubdomain = async ({
|
||||
subdomain,
|
||||
@@ -59,6 +58,16 @@ const expandSite = async (site: Profile) => {
|
||||
site.name = site.name || site.username
|
||||
site.description = (await renderPageContent(site.bio || "")).contentHTML
|
||||
|
||||
if (site.avatars) {
|
||||
site.avatars = site.avatars.map((avatar) => toGateway(avatar))
|
||||
}
|
||||
if (site.banners) {
|
||||
site.banners.map((banner) => {
|
||||
banner.address = toGateway(banner.address)
|
||||
return banner
|
||||
})
|
||||
}
|
||||
|
||||
return site
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user