aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/ServicesStore.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/ServicesStore.ts')
-rw-r--r--src/stores/ServicesStore.ts41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/stores/ServicesStore.ts b/src/stores/ServicesStore.ts
index 829c64d76..9c15d3a07 100644
--- a/src/stores/ServicesStore.ts
+++ b/src/stores/ServicesStore.ts
@@ -294,19 +294,20 @@ export default class ServicesStore extends TypedStore {
294 service.lastPoll - service.lastPollAnswer > ms('1m') 294 service.lastPoll - service.lastPollAnswer > ms('1m')
295 ) { 295 ) {
296 // If service did not reply for more than 1m try to reload. 296 // If service did not reply for more than 1m try to reload.
297 if (!service.isActive) { 297 if (service.isActive) {
298 if (this.stores.app.isOnline && service.lostRecipeReloadAttempt < 3) {
299 debug(
300 `Reloading service: ${service.name} (${service.id}). Attempt: ${service.lostRecipeReloadAttempt}`,
301 );
302 // service.webview.reload();
303 service.lostRecipeReloadAttempt += 1;
304
305 service.lostRecipeConnection = false;
306 }
307 } else {
308 debug(`Service lost connection: ${service.name} (${service.id}).`); 298 debug(`Service lost connection: ${service.name} (${service.id}).`);
309 service.lostRecipeConnection = true; 299 service.lostRecipeConnection = true;
300 } else if (
301 this.stores.app.isOnline &&
302 service.lostRecipeReloadAttempt < 3
303 ) {
304 debug(
305 `Reloading service: ${service.name} (${service.id}). Attempt: ${service.lostRecipeReloadAttempt}`,
306 );
307 // service.webview.reload();
308 service.lostRecipeReloadAttempt += 1;
309
310 service.lostRecipeConnection = false;
310 } 311 }
311 } else { 312 } else {
312 service.lostRecipeConnection = false; 313 service.lostRecipeConnection = false;
@@ -512,11 +513,11 @@ export default class ServicesStore extends TypedStore {
512 } 513 }
513 514
514 if (data.team) { 515 if (data.team) {
515 if (!data.customURL) { 516 if (data.customURL) {
516 serviceData.team = data.team;
517 } else {
518 // TODO: Is this correct? 517 // TODO: Is this correct?
519 serviceData.customUrl = data.team; 518 serviceData.customUrl = data.team;
519 } else {
520 serviceData.team = data.team;
520 } 521 }
521 } 522 }
522 523
@@ -893,9 +894,7 @@ export default class ServicesStore extends TypedStore {
893 break; 894 break;
894 } 895 }
895 case 'set-service-spellchecker-language': { 896 case 'set-service-spellchecker-language': {
896 if (!args) { 897 if (args) {
897 console.warn('Did not receive locale');
898 } else {
899 this.actions.service.updateService({ 898 this.actions.service.updateService({
900 serviceId, 899 serviceId,
901 serviceData: { 900 serviceData: {
@@ -903,6 +902,8 @@ export default class ServicesStore extends TypedStore {
903 }, 902 },
904 redirect: false, 903 redirect: false,
905 }); 904 });
905 } else {
906 console.warn('Did not receive locale');
906 } 907 }
907 908
908 break; 909 break;
@@ -1176,13 +1177,13 @@ export default class ServicesStore extends TypedStore {
1176 service.lastPoll = Date.now(); 1177 service.lastPoll = Date.now();
1177 }; 1178 };
1178 1179
1179 if (!serviceId) { 1180 if (serviceId) {
1180 for (const service of this.allDisplayed) resetTimer(service);
1181 } else {
1182 const service = this.one(serviceId); 1181 const service = this.one(serviceId);
1183 if (service) { 1182 if (service) {
1184 resetTimer(service); 1183 resetTimer(service);
1185 } 1184 }
1185 } else {
1186 for (const service of this.allDisplayed) resetTimer(service);
1186 } 1187 }
1187 } 1188 }
1188 1189