feat(SW-1543): move auth check within component to be suspended
This commit is contained in:
@@ -23,7 +23,6 @@ import {
|
||||
TrackingChannelEnum,
|
||||
type TrackingSDKPageData,
|
||||
} from "@/types/components/tracking"
|
||||
import { BlocksEnums } from "@/types/enums/blocks"
|
||||
import type {
|
||||
GetStartPageData,
|
||||
GetStartPageRefsSchema,
|
||||
@@ -184,21 +183,8 @@ export const startPageQueryRouter = router({
|
||||
siteVersion: "new-web",
|
||||
}
|
||||
|
||||
const session = await ctx.auth()
|
||||
|
||||
return {
|
||||
startPage: {
|
||||
...startPage.data.start_page,
|
||||
blocks: startPage.data.start_page.blocks.filter((block) => {
|
||||
if (
|
||||
block.typename === BlocksEnums.block.JoinScandicFriends &&
|
||||
session
|
||||
) {
|
||||
return null
|
||||
}
|
||||
return block
|
||||
}),
|
||||
},
|
||||
startPage: startPage.data.start_page,
|
||||
tracking,
|
||||
}
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user