File tree 1 file changed +3
-3
lines changed
js-sdk/integrations/react/next
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -164,21 +164,21 @@ import { ALL_LANGUAGES, DEFAULT_LANGUAGE } from './shared';
164
164
const LANGUAGE_COOKIE = ' NEXT_LOCALE' ;
165
165
166
166
export async function setLanguage(locale : string ) {
167
- const cookieStore = cookies ();
167
+ const cookieStore = await cookies ();
168
168
cookieStore .set (LANGUAGE_COOKIE , locale , {
169
169
maxAge: 1000 * 60 * 60 * 24 * 365 , // one year in milisecods
170
170
});
171
171
}
172
172
173
173
export async function getLanguage() {
174
- const cookieStore = cookies ();
174
+ const cookieStore = await cookies ();
175
175
const locale = cookieStore .get (LANGUAGE_COOKIE )?.value ;
176
176
if (locale && ALL_LANGUAGES .includes (locale )) {
177
177
return locale ;
178
178
}
179
179
180
180
// try to detect language from headers or use default
181
- const detected = detectLanguageFromHeaders (headers (), ALL_LANGUAGES );
181
+ const detected = detectLanguageFromHeaders (await headers (), ALL_LANGUAGES );
182
182
return detected || DEFAULT_LANGUAGE ;
183
183
}
184
184
```
You can’t perform that action at this time.
0 commit comments