From 707cb7f955cc857b79c461720fb4c942f528c638 Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Wed, 24 Jul 2019 12:33:50 +0200
Subject: [PATCH] fix call shortcut

---
 src/frontend/service/header.service.ts | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/frontend/service/header.service.ts b/src/frontend/service/header.service.ts
index c5c9c3154a7..8ff773977bd 100755
--- a/src/frontend/service/header.service.ts
+++ b/src/frontend/service/header.service.ts
@@ -33,14 +33,15 @@ export class HeaderService {
     }
 
     getShortcut() {
-        this.http.get('../../rest/shortcuts').pipe(
-            filter(() => this.shortcut === null),
-            tap((data: any) => this.setShortcut(data.shortcuts)),
-            catchError((err: any) => {
-                console.log(err);
-                return of(false);
-            })
-        ).subscribe();
+        if (this.shortcut === null) {
+            this.http.get('../../rest/shortcuts').pipe(
+                tap((data: any) => this.setShortcut(data.shortcuts)),
+                catchError((err: any) => {
+                    console.log(err);
+                    return of(false);
+                })
+            ).subscribe();
+        }
     }
 
     refreshShortcuts() {
-- 
GitLab