Commit 10a5a6b2 authored by dev0tion's avatar dev0tion

Cancel subscriptions on API disconnect

parent ca3eb31e
......@@ -65,6 +65,7 @@ export class DashboardComponent implements OnInit {
error => {
console.log(error);
if (error.status === 0) {
this.cancelSubscriptions();
alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) {
if (!error.json().errors[0]) {
......@@ -101,6 +102,7 @@ export class DashboardComponent implements OnInit {
error => {
console.log(error);
if (error.status === 0) {
this.cancelSubscriptions();
alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) {
if (!error.json().errors[0]) {
......
......@@ -57,6 +57,7 @@ export class HistoryComponent {
error => {
console.log(error);
if (error.status === 0) {
this.cancelSubscriptions();
alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) {
if (!error.json().errors[0]) {
......
......@@ -60,6 +60,7 @@ export class StatusBarComponent implements OnInit {
error => {
console.log(error);
if (error.status === 0) {
this.cancelSubscriptions();
alert("Something went wrong while connecting to the API. Please restart the application.");
} else if (error.status >= 400) {
if (!error.json().errors[0]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment