Merged in chore/more-partner-sas-boilerplate (pull request #2756)

chore: Misc for partner-sas

* Add global-error to partner-sas

* Add redirect to lang in partner-sas

* Actually use language from param

* Increase test timeouts and use parsed lang to fix tests

* Remove need to import serverClient to setup trpc


Approved-by: Hrishikesh Vaipurkar
This commit is contained in:
Anton Gunnarsson
2025-09-04 07:45:14 +00:00
parent 36b6685ad5
commit 7e585b2d9a
9 changed files with 162 additions and 26 deletions

View File

@@ -18,7 +18,11 @@ const getRef = cache(() => ({ current: undefined as Lang | undefined }))
*/
export function setLang(newLang: Lang) {
const parseResult = languageSchema.safeParse(newLang)
getRef().current = parseResult.success ? parseResult.data : Lang.en
const parsedLanguage = parseResult.success ? parseResult.data : Lang.en
getRef().current = parsedLanguage
return parsedLanguage
}
/**