zahmis 4 lat temu
rodzic
commit
2ef6dead51

+ 6 - 5
packages/slackbot-proxy/src/services/RelationsService.ts

@@ -121,7 +121,6 @@ export class RelationsService {
     });
     });
   }
   }
 
 
-  isPermittedForInteractions = false;
 
 
   permissionForInteractions:boolean|string[];
   permissionForInteractions:boolean|string[];
 
 
@@ -132,9 +131,11 @@ export class RelationsService {
 
 
     const baseDate = new Date();
     const baseDate = new Date();
     const syncedRelation = await this.syncRelation(relation, baseDate);
     const syncedRelation = await this.syncRelation(relation, baseDate);
+    let isPermittedForInteractions = false;
+
 
 
     if (syncedRelation == null) {
     if (syncedRelation == null) {
-      this.isPermittedForInteractions = false;
+      isPermittedForInteractions = false;
       return;
       return;
     }
     }
 
 
@@ -152,13 +153,13 @@ export class RelationsService {
       }
       }
 
 
       if (this.permissionForInteractions === true) {
       if (this.permissionForInteractions === true) {
-        this.isPermittedForInteractions = true;
+        isPermittedForInteractions = true;
         return;
         return;
       }
       }
 
 
       // check permission at channel level
       // check permission at channel level
       if (Array.isArray(this.permissionForInteractions)) {
       if (Array.isArray(this.permissionForInteractions)) {
-        this.isPermittedForInteractions = this.permissionForInteractions.includes(channelName);
+        isPermittedForInteractions = this.permissionForInteractions.includes(channelName);
         return;
         return;
       }
       }
 
 
@@ -170,7 +171,7 @@ export class RelationsService {
         return;
         return;
       }
       }
 
 
-      if (!this.isPermittedForInteractions) {
+      if (!isPermittedForInteractions) {
         this.postNotAllowedMessage(relations, commandName, body);
         this.postNotAllowedMessage(relations, commandName, body);
       }
       }
     });
     });