瀏覽代碼

Disable notifications while on Login page

Any error while on login page is already shown above the login form.
Sergiu Miclea 8 年之前
父節點
當前提交
abf25b8c89
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/utils/ApiCaller.js

+ 3 - 1
src/utils/ApiCaller.js

@@ -102,7 +102,9 @@ class ApiCaller {
         } else if (error.request) {
           // The request was made but no response was received
           // `error.request` is an instance of XMLHttpRequest
-          NotificationStore.notify('Request failed, there might be a problem with the connection to the server.', 'error')
+          if (window.location.hash !== loginUrl) {
+            NotificationStore.notify('Request failed, there might be a problem with the connection to the server.', 'error')
+          }
           console.log(`%cError No Response: ${axiosOptions.url}`, 'color: #D0021B')
           reject({})
         } else {