You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by qi...@apache.org on 2020/09/04 08:22:46 UTC

[skywalking-rocketbot-ui] branch master updated: Fix: Update localtime.ts (#352)

This is an automated email from the ASF dual-hosted git repository.

qiuxiafan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-rocketbot-ui.git


The following commit(s) were added to refs/heads/master by this push:
     new 2302eab  Fix: Update localtime.ts (#352)
2302eab is described below

commit 2302eabc1e22d5010a87993fefdc1176ec850344
Author: O-ll-O <48...@users.noreply.github.com>
AuthorDate: Fri Sep 4 16:22:38 2020 +0800

    Fix: Update localtime.ts (#352)
    
    if  bankend services info is Empty ,browser have a error :res.data.data.getTimeInfo.timezone undefined
    
    Co-authored-by: 吴晟 Wu Sheng <wu...@foxmail.com>
---
 src/utils/localtime.ts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/utils/localtime.ts b/src/utils/localtime.ts
index 5cbb06a..7cb9ded 100644
--- a/src/utils/localtime.ts
+++ b/src/utils/localtime.ts
@@ -37,8 +37,9 @@ export const queryOAPTimeInfo = async () => {
   let utc = window.localStorage.getItem('utc');
   if (!utc) {
     const res: AxiosResponse = await graph.query('queryOAPTimeInfo').params({});
-    if (!res.data) {
+    if (!res.data || !res.data.data || !res.data.data.getTimeInfo || !res.data.data.getTimeInfo.timezone) {
       setTimezoneOffset();
+      return;
     }
     utc = res.data.data.getTimeInfo.timezone / 100 + '';
     window.localStorage.setItem('utc', utc);