mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-14 11:17:57 +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 {
|
export default abstract class AppI18n {
|
||||||
public static getUserLocale(): Locale {
|
public static getUserLocale(): Locale {
|
||||||
const account = fetchAccount();
|
// @Todo Hack: Try page must not account info. Add this to avoid 403 errors.
|
||||||
return account?.locale ? account.locale : this.getBrowserLocale();
|
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 {
|
public static getBrowserLocale(): Locale {
|
||||||
|
Loading…
Reference in New Issue
Block a user