Fixed the preset themes issue

This commit is contained in:
tidusjar 2017-11-21 20:37:57 +00:00
commit 169b73047a
2 changed files with 9 additions and 1 deletions

View file

@ -55,6 +55,14 @@ export class ServiceAuthHelpers {
} }
} }
protected extractContentData(res: Response) {
if(res.text()) {
return res.text();
} else {
return "";
}
}
protected handleError(error: any) { protected handleError(error: any) {
// In a real world app, we might use a remote logging infrastructure // In a real world app, we might use a remote logging infrastructure
// We'd also dig deeper into the error to get a better message // We'd also dig deeper into the error to get a better message

View file

@ -129,7 +129,7 @@ export class SettingsService extends ServiceAuthHelpers {
} }
public getThemeContent(themeUrl: string): Observable<string> { public getThemeContent(themeUrl: string): Observable<string> {
return this.httpAuth.get(`${this.url}/themecontent?url=${themeUrl}`).map(this.extractData).catch(this.handleError); return this.httpAuth.get(`${this.url}/themecontent?url=${themeUrl}`).map(this.extractContentData).catch(this.handleError);
} }
public getEmailNotificationSettings(): Observable<IEmailNotificationSettings> { public getEmailNotificationSettings(): Observable<IEmailNotificationSettings> {