Merged in fix/feature-flag-scopes (pull request #743)
Fix/feature flag scopes Approved-by: Christel Westerberg
This commit is contained in:
@@ -1,8 +1,14 @@
|
|||||||
|
import { env } from "@/env/server"
|
||||||
|
|
||||||
import LoadingSpinner from "@/components/LoadingSpinner"
|
import LoadingSpinner from "@/components/LoadingSpinner"
|
||||||
|
|
||||||
import styles from "./loading.module.css"
|
import styles from "./loading.module.css"
|
||||||
|
|
||||||
export default function LoadingBookingWidget() {
|
export default function LoadingBookingWidget() {
|
||||||
|
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<LoadingSpinner />
|
<LoadingSpinner />
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
|
import { env } from "@/env/server"
|
||||||
import { serverClient } from "@/lib/trpc/server"
|
import { serverClient } from "@/lib/trpc/server"
|
||||||
|
|
||||||
import BookingWidget, { preload } from "@/components/BookingWidget"
|
import BookingWidget, { preload } from "@/components/BookingWidget"
|
||||||
|
|
||||||
export default async function BookingWidgetPage() {
|
export default async function BookingWidgetPage() {
|
||||||
|
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
preload()
|
preload()
|
||||||
|
|
||||||
// Get the booking widget show/hide status based on page specific settings
|
// Get the booking widget show/hide status based on page specific settings
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
import { Suspense } from "react"
|
import { Suspense } from "react"
|
||||||
|
|
||||||
|
import { env } from "@/env/server"
|
||||||
|
|
||||||
import SitewideAlert, { preload } from "@/components/SitewideAlert"
|
import SitewideAlert, { preload } from "@/components/SitewideAlert"
|
||||||
import { setLang } from "@/i18n/serverContext"
|
import { setLang } from "@/i18n/serverContext"
|
||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default function SitewideAlertPage({ params }: PageArgs<LangParams>) {
|
export default function SitewideAlertPage({ params }: PageArgs<LangParams>) {
|
||||||
|
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
setLang(params.lang)
|
setLang(params.lang)
|
||||||
preload()
|
preload()
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,12 @@ async function fetchServiceToken(scopes: string[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getServiceToken() {
|
export async function getServiceToken() {
|
||||||
const scopes = ["profile", "hotel", "booking"]
|
let scopes: string[] = []
|
||||||
|
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||||
|
scopes = ["profile"]
|
||||||
|
} else {
|
||||||
|
scopes = ["profile", "hotel", "booking"]
|
||||||
|
}
|
||||||
const tag = generateServiceTokenTag(scopes)
|
const tag = generateServiceTokenTag(scopes)
|
||||||
const getCachedJwt = unstable_cache(
|
const getCachedJwt = unstable_cache(
|
||||||
async (scopes) => {
|
async (scopes) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user