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,
|
TrackingChannelEnum,
|
||||||
type TrackingSDKPageData,
|
type TrackingSDKPageData,
|
||||||
} from "@/types/components/tracking"
|
} from "@/types/components/tracking"
|
||||||
|
import { BlocksEnums } from "@/types/enums/blocks"
|
||||||
import type {
|
import type {
|
||||||
GetStartPageData,
|
GetStartPageData,
|
||||||
GetStartPageRefsSchema,
|
GetStartPageRefsSchema,
|
||||||
@@ -183,8 +184,21 @@ export const startPageQueryRouter = router({
|
|||||||
siteVersion: "new-web",
|
siteVersion: "new-web",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const session = await ctx.auth()
|
||||||
|
|
||||||
return {
|
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,
|
tracking,
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user