Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function* handleStorageLoad() {
const currentLocale = yield select(getLocale)
const urlParams = new URLSearchParams(window.location.search)
const locale = urlParams.get('locale')
const locales = Object.keys(languages)
if (locale && locale !== currentLocale && locales.includes(locale)) {
yield put(changeLocale(locale as Locale))
}
}