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.ts17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/stores/ServicesStore.ts b/src/stores/ServicesStore.ts
index 7f4693cad..82f3b95ce 100644
--- a/src/stores/ServicesStore.ts
+++ b/src/stores/ServicesStore.ts
@@ -594,7 +594,7 @@ export default class ServicesStore extends TypedStore {
594 this.stores.router.push(redirect); 594 this.stores.router.push(redirect);
595 } 595 }
596 596
597 this.allServicesRequest.patch(result => { 597 this.allServicesRequest.patch((result: Service[]) => {
598 remove(result, (c: Service) => c.id === serviceId); 598 remove(result, (c: Service) => c.id === serviceId);
599 }); 599 });
600 600
@@ -606,7 +606,7 @@ export default class ServicesStore extends TypedStore {
606 // Get directory for recipe 606 // Get directory for recipe
607 const normalDirectory = getRecipeDirectory(recipe); 607 const normalDirectory = getRecipeDirectory(recipe);
608 const devDirectory = getDevRecipeDirectory(recipe); 608 const devDirectory = getDevRecipeDirectory(recipe);
609 let directory; 609 let directory: string;
610 610
611 if (pathExistsSync(normalDirectory)) { 611 if (pathExistsSync(normalDirectory)) {
612 directory = normalDirectory; 612 directory = normalDirectory;
@@ -1028,7 +1028,7 @@ export default class ServicesStore extends TypedStore {
1028 } 1028 }
1029 1029
1030 this.reorderServicesRequest.execute(services); 1030 this.reorderServicesRequest.execute(services);
1031 this.allServicesRequest.patch(data => { 1031 this.allServicesRequest.patch((data: Service[]) => {
1032 for (const s of data) { 1032 for (const s of data) {
1033 s.order = services[s.id]; 1033 s.order = services[s.id];
1034 } 1034 }
@@ -1172,7 +1172,7 @@ export default class ServicesStore extends TypedStore {
1172 ); 1172 );
1173 1173
1174 // eslint-disable-next-line unicorn/consistent-function-scoping 1174 // eslint-disable-next-line unicorn/consistent-function-scoping
1175 const resetTimer = service => { 1175 const resetTimer = (service: Service) => {
1176 service.lastPollAnswer = Date.now(); 1176 service.lastPollAnswer = Date.now();
1177 service.lastPoll = Date.now(); 1177 service.lastPoll = Date.now();
1178 }; 1178 };
@@ -1306,7 +1306,7 @@ export default class ServicesStore extends TypedStore {
1306 }); 1306 });
1307 } 1307 }
1308 1308
1309 _cleanUpTeamIdAndCustomUrl(recipeId, data): any { 1309 _cleanUpTeamIdAndCustomUrl(recipeId: string, data: Service): any {
1310 const serviceData = data; 1310 const serviceData = data;
1311 const recipe = this.stores.recipes.one(recipeId); 1311 const recipe = this.stores.recipes.one(recipeId);
1312 1312
@@ -1318,6 +1318,7 @@ export default class ServicesStore extends TypedStore {
1318 data.team && 1318 data.team &&
1319 data.customUrl 1319 data.customUrl
1320 ) { 1320 ) {
1321 // @ts-expect-error The operand of a 'delete' operator must be optional.
1321 delete serviceData.team; 1322 delete serviceData.team;
1322 } 1323 }
1323 1324
@@ -1343,7 +1344,7 @@ export default class ServicesStore extends TypedStore {
1343 } 1344 }
1344 1345
1345 // Helper 1346 // Helper
1346 _initializeServiceRecipeInWebview(serviceId) { 1347 _initializeServiceRecipeInWebview(serviceId: string) {
1347 const service = this.one(serviceId); 1348 const service = this.one(serviceId);
1348 1349
1349 if (service.webview) { 1350 if (service.webview) {
@@ -1362,7 +1363,7 @@ export default class ServicesStore extends TypedStore {
1362 } 1363 }
1363 } 1364 }
1364 1365
1365 _initRecipePolling(serviceId) { 1366 _initRecipePolling(serviceId: string) {
1366 const service = this.one(serviceId); 1367 const service = this.one(serviceId);
1367 1368
1368 const delay = ms('2s'); 1369 const delay = ms('2s');
@@ -1385,7 +1386,7 @@ export default class ServicesStore extends TypedStore {
1385 } 1386 }
1386 } 1387 }
1387 1388
1388 _wrapIndex(index, delta, size) { 1389 _wrapIndex(index: number, delta: number, size: number) {
1389 return (((index + delta) % size) + size) % size; 1390 return (((index + delta) % size) + size) % size;
1390 } 1391 }
1391} 1392}