Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
use the new lookup format when handling language
Browse files Browse the repository at this point in the history
  • Loading branch information
teosarca committed Dec 12, 2017
1 parent a349362 commit 434dee3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/actions/AppActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,14 @@ export function loginSuccess(auth) {

getUserSession().then(session => {
dispatch(userSessionInit(session.data));
languageSuccess(Object.keys(session.data.language)[0]);
initNumeralLocales(
Object.keys(session.data.language)[0],
session.data.locale
);
languageSuccess(session.data.language["key"]);
initNumeralLocales(session.data.language["key"], session.data.locale);

auth.initSessionClient(session.data.websocketEndpoint, msg => {
const me = JSON.parse(msg.body);
dispatch(userSessionUpdate(me));
me.language && languageSuccess(Object.keys(me.language)[0]);
me.locale && initNumeralLocales(Object.keys(me.language)[0], me.locale);
me.language && languageSuccess(me.language["key"]);
me.locale && initNumeralLocales(me.language["key"], me.locale);

getNotifications().then(response => {
dispatch(
Expand Down
2 changes: 1 addition & 1 deletion src/components/app/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class LoginForm extends Component {

getUserLang().then(response => {
//GET language shall always return a result
Moment.locale(Object.keys(response.data)[0]);
Moment.locale(response.data["key"]);

if (redirect) {
dispatch(goBack());
Expand Down

0 comments on commit 434dee3

Please sign in to comment.