Skip to content

Commit b0d6fa9

Browse files
committed
fix: assign correct context property in hook argument
1 parent a226a0d commit b0d6fa9

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/runtime/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ export async function loadAndSetLocale(locale: Locale): Promise<string> {
190190
return locale
191191
}
192192

193-
const data = { oldLocale, newLocale: locale, initialSetup: ctx.firstAccess, nuxt }
194-
// @ts-expect-error context is not typed
193+
const data = { oldLocale, newLocale: locale, initialSetup: ctx.firstAccess, context: nuxt }
195194
let override = (await nuxt.callHook('i18n:beforeLocaleSwitch', data)) as string | undefined
196195
if (override != null && import.meta.dev) {
197196
console.warn('[nuxt-i18n] Do not return in `i18n:beforeLocaleSwitch`, mutate `data.newLocale` instead.')

0 commit comments

Comments
 (0)