mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-10 17:33:24 +01:00
Hack browser locale on try page.
This commit is contained in:
parent
88ca3d92d0
commit
4e01d20ad4
@ -17,8 +17,16 @@ export class Locale {
|
||||
|
||||
export default abstract class AppI18n {
|
||||
public static getUserLocale(): Locale {
|
||||
const account = fetchAccount();
|
||||
return account?.locale ? account.locale : this.getBrowserLocale();
|
||||
// @Todo Hack: Try page must not account info. Add this to avoid 403 errors.
|
||||
const isTryPage = window.location.href.endsWith('/try');
|
||||
let result: Locale;
|
||||
if (!isTryPage) {
|
||||
const account = fetchAccount();
|
||||
result = account?.locale ? account.locale : this.getBrowserLocale();
|
||||
} else {
|
||||
result = this.getBrowserLocale();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static getBrowserLocale(): Locale {
|
||||
|
Loading…
Reference in New Issue
Block a user