fix: useClientHeaders returning an empty object

This commit is contained in:
Mahdi Boomeri
2022-08-31 19:13:29 +04:30
parent 019bb20e50
commit 1e67434a8f
2 changed files with 4 additions and 8 deletions

View File

@@ -13,13 +13,10 @@ export default defineNuxtPlugin((nuxtApp) => {
const client = trpc.createTRPCClient<AppRouter>({
url: `${config.baseURL}${config.endpoint}`,
headers: () => {
if (nuxtApp.ssrContext) {
return {
...unref(otherHeaders),
...headers,
}
return {
...unref(otherHeaders),
...headers,
}
return {}
},
})