Commit 0fee3c89 by Tuukka Kivilahti

changes from commits

1 parent cc6f71f5
...@@ -55,17 +55,17 @@ export class MoyaLocaleService { ...@@ -55,17 +55,17 @@ export class MoyaLocaleService {
* @param {string} locale * @param {string} locale
* @return {Promise<any>} This will return promise, but it will contain nothing. * @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(); const newLocale: MoyaLocale = new MoyaLocale();
newLocale.userLocale = locale; newLocale.userLocale = locale;
// let's save locale to database, if it fails, we save it into localstorage. No errors to show for user. // 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); localStorage.setItem(LOCALSTORAGE_NAME, locale);
return 'ok'; return 'ok';
}); }).subscribe();
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!