Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0fee3c89
authored
Apr 01, 2018
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes from commits
1 parent
cc6f71f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
code/moya-angular/src/app/components/moya-locale/moya-locale.service.ts
code/moya-angular/src/app/components/moya-locale/moya-locale.service.ts
View file @
0fee3c8
...
...
@@ -55,17 +55,17 @@ export class MoyaLocaleService {
* @param {string} locale
* @return {Promise<any>} This will return promise, but it will contain nothing.
*/
public
setUserLocale
(
locale
:
string
):
Observable
<
any
>
{
public
setUserLocale
(
locale
:
string
):
void
{
const
newLocale
:
MoyaLocale
=
new
MoyaLocale
();
newLocale
.
userLocale
=
locale
;
// let's save locale to database, if it fails, we save it into localstorage. No errors to show for user.
return
this
.
http
.
post
(
MOYA_BASE_URL
+
'/v3/locale/'
,
newLocale
).
first
().
catch
(
x
=>
{
this
.
http
.
post
(
MOYA_BASE_URL
+
'/v3/locale/'
,
newLocale
).
first
().
catch
(
x
=>
{
localStorage
.
setItem
(
LOCALSTORAGE_NAME
,
locale
);
return
'ok'
;
});
})
.
subscribe
()
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment