notify error
This commit is contained in:
parent
30f678af04
commit
8cd4d30ac8
|
@ -7,6 +7,8 @@ import { LanguageService } from '../../../../services/language.service';
|
||||||
import { InstancesInfoService } from '../../../../services/instances-info.service';
|
import { InstancesInfoService } from '../../../../services/instances-info.service';
|
||||||
import { MastodonWrapperService } from '../../../../services/mastodon-wrapper.service';
|
import { MastodonWrapperService } from '../../../../services/mastodon-wrapper.service';
|
||||||
import { Translation } from '../../../../services/models/mastodon.interfaces';
|
import { Translation } from '../../../../services/models/mastodon.interfaces';
|
||||||
|
import { NotificationService } from '../../../../services/notification.service';
|
||||||
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-status-translate',
|
selector: 'app-status-translate',
|
||||||
|
@ -31,6 +33,7 @@ export class StatusTranslateComponent implements OnInit, OnDestroy {
|
||||||
private readonly mastodonWrapperService: MastodonWrapperService,
|
private readonly mastodonWrapperService: MastodonWrapperService,
|
||||||
private readonly languageService: LanguageService,
|
private readonly languageService: LanguageService,
|
||||||
private readonly instancesInfoService: InstancesInfoService,
|
private readonly instancesInfoService: InstancesInfoService,
|
||||||
|
private readonly notificationService: NotificationService
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -82,8 +85,9 @@ export class StatusTranslateComponent implements OnInit, OnDestroy {
|
||||||
this.translatedBy = x.provider;
|
this.translatedBy = x.provider;
|
||||||
this.isTranslationAvailable = false;
|
this.isTranslationAvailable = false;
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch((err: HttpErrorResponse) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
this.notificationService.notifyHttpError(err, this.status.provider);
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue