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