Utilizing memoized requests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
import { getName } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import LoginButton from "@/components/Current/Header/LoginButton"
|
||||
import ArrowRight from "@/components/Icons/ArrowRight"
|
||||
@@ -19,10 +19,10 @@ export default async function JoinLoyaltyContact({
|
||||
block,
|
||||
}: JoinLoyaltyContactProps) {
|
||||
const intl = await getIntl()
|
||||
const user = await serverClient().user.name()
|
||||
const username = await getName()
|
||||
|
||||
// Check if we have user, that means we are logged in.
|
||||
if (user) {
|
||||
if (username) {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
import { getName } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import MyPagesSidebar from "@/components/MyPages/Sidebar"
|
||||
|
||||
export default async function MyPagesNavigation() {
|
||||
const user = await serverClient().user.name()
|
||||
const username = await getName()
|
||||
|
||||
// Check if we have user, that means we are logged in andt the My Pages menu can show.
|
||||
if (!user) {
|
||||
if (!username) {
|
||||
return null
|
||||
}
|
||||
return <MyPagesSidebar />
|
||||
|
||||
Reference in New Issue
Block a user