You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by sh...@apache.org on 2024/01/19 08:01:41 UTC

(incubator-answer) branch feat/1.2.5/ui updated: fix: remove console

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

shuai pushed a commit to branch feat/1.2.5/ui
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


The following commit(s) were added to refs/heads/feat/1.2.5/ui by this push:
     new d159809f fix: remove console
d159809f is described below

commit d159809fb1c964d15e35ce5111880566394f8990
Author: shuai <li...@sifou.com>
AuthorDate: Fri Jan 19 16:01:30 2024 +0800

    fix: remove console
---
 ui/src/components/Comment/index.tsx                               | 2 --
 ui/src/components/Editor/ToolBars/image.tsx                       | 2 +-
 ui/src/components/TagSelector/index.tsx                           | 3 ---
 ui/src/pages/Install/components/FourthStep/index.tsx              | 1 -
 ui/src/pages/Questions/Detail/components/InviteToAnswer/index.tsx | 2 +-
 ui/src/pages/Review/index.tsx                                     | 6 +++---
 ui/src/pages/Timeline/index.tsx                                   | 2 --
 ui/src/pages/Users/Settings/Interface/index.tsx                   | 2 --
 ui/src/utils/guard.ts                                             | 4 +---
 ui/src/utils/localize.ts                                          | 3 +--
 10 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/ui/src/components/Comment/index.tsx b/ui/src/components/Comment/index.tsx
index b69cb1c8..7dad8e0f 100644
--- a/ui/src/components/Comment/index.tsx
+++ b/ui/src/components/Comment/index.tsx
@@ -74,10 +74,8 @@ const Comment = ({ objectId, mode, commentId }) => {
 
   useEffect(() => {
     if (pageIndex === 0 && commentId) {
-      console.log('scrollCallback');
       setTimeout(() => {
         const el = document.getElementById(commentId);
-        console.log(el);
         scrollToElementTop(el);
         bgFadeOut(el);
       }, 100);
diff --git a/ui/src/components/Editor/ToolBars/image.tsx b/ui/src/components/Editor/ToolBars/image.tsx
index 48f1b039..95737db6 100644
--- a/ui/src/components/Editor/ToolBars/image.tsx
+++ b/ui/src/components/Editor/ToolBars/image.tsx
@@ -117,7 +117,7 @@ const Image = ({ editorInstance }) => {
 
     editor.replaceSelection(loadingText);
     const urls = await upload(fileList).catch((ex) => {
-      console.log('ex: ', ex);
+      console.error('upload file error: ', ex);
     });
 
     const text: string[] = [];
diff --git a/ui/src/components/TagSelector/index.tsx b/ui/src/components/TagSelector/index.tsx
index 20ef0a2c..5afffc0d 100644
--- a/ui/src/components/TagSelector/index.tsx
+++ b/ui/src/components/TagSelector/index.tsx
@@ -128,13 +128,11 @@ const TagSelector: FC<IProps> = ({
   };
 
   const handleTagSelectorFocus = () => {
-    console.log('foucsed 555');
     setFocusState(true);
     inputRef.current?.focus();
   };
 
   const handleTagSelectorBlur = () => {
-    console.log('tab key pressed666');
     setFocusState(false);
     setCurrentIndex(0);
     handleMenuShow(false);
@@ -221,7 +219,6 @@ const TagSelector: FC<IProps> = ({
     e.stopPropagation();
     const { keyCode } = e;
     if (keyCode === 9) {
-      console.log('tab key pressed');
       handleTagSelectorBlur();
       return;
     }
diff --git a/ui/src/pages/Install/components/FourthStep/index.tsx b/ui/src/pages/Install/components/FourthStep/index.tsx
index 7a4a3fca..65ffd9d5 100644
--- a/ui/src/pages/Install/components/FourthStep/index.tsx
+++ b/ui/src/pages/Install/components/FourthStep/index.tsx
@@ -259,7 +259,6 @@ const Index: FC<Props> = ({ visible, data, changeCallback, nextCallback }) => {
           label={t('login_required.switch')}
           checked={data.login_required.value}
           onChange={(e) => {
-            console.log(e.target.checked);
             changeCallback({
               login_required: {
                 value: e.target.checked,
diff --git a/ui/src/pages/Questions/Detail/components/InviteToAnswer/index.tsx b/ui/src/pages/Questions/Detail/components/InviteToAnswer/index.tsx
index a31a442e..82f9fa27 100644
--- a/ui/src/pages/Questions/Detail/components/InviteToAnswer/index.tsx
+++ b/ui/src/pages/Questions/Detail/components/InviteToAnswer/index.tsx
@@ -93,7 +93,7 @@ const Index: FC<Props> = ({ questionId, readOnly = false }) => {
           if (ex.isError) {
             iaCaptcha.handleCaptchaError(ex.list);
           }
-          console.log('ex: ', ex);
+          console.error('putInviteUser error: ', ex);
         });
     });
   };
diff --git a/ui/src/pages/Review/index.tsx b/ui/src/pages/Review/index.tsx
index 087ecad7..927e95a1 100644
--- a/ui/src/pages/Review/index.tsx
+++ b/ui/src/pages/Review/index.tsx
@@ -68,7 +68,7 @@ const Index: FC = () => {
         resolveNextOne(resp, pageNumber);
       })
       .catch((ex) => {
-        console.log('ex: ', ex);
+        console.error('review next error: ', ex);
       });
   };
   const reviewInfo = unreviewed_info?.content;
@@ -85,7 +85,7 @@ const Index: FC = () => {
         queryNextOne(page);
       })
       .catch((ex) => {
-        console.log('ex: ', ex);
+        console.error('revisionAudit approve error: ', ex);
       })
       .finally(() => {
         setIsLoading(false);
@@ -101,7 +101,7 @@ const Index: FC = () => {
         queryNextOne(page);
       })
       .catch((ex) => {
-        console.log('ex: ', ex);
+        console.error('revisionAudit reject error: ', ex);
       })
       .finally(() => {
         setIsLoading(false);
diff --git a/ui/src/pages/Timeline/index.tsx b/ui/src/pages/Timeline/index.tsx
index e20d50ef..0a7816fa 100644
--- a/ui/src/pages/Timeline/index.tsx
+++ b/ui/src/pages/Timeline/index.tsx
@@ -98,8 +98,6 @@ const Index: FC = () => {
   usePageTags({
     title: pageTitle,
   });
-
-  console.log('timelineData', linkUrl);
   return (
     <div className="py-4 mb-5">
       <h5 className="mb-4">
diff --git a/ui/src/pages/Users/Settings/Interface/index.tsx b/ui/src/pages/Users/Settings/Interface/index.tsx
index db91acf1..575995ed 100644
--- a/ui/src/pages/Users/Settings/Interface/index.tsx
+++ b/ui/src/pages/Users/Settings/Interface/index.tsx
@@ -92,8 +92,6 @@ const Index = () => {
     setLangs(res);
   };
 
-  console.log(formData.color_scheme, '3333');
-
   const handleOnChange = (d) => {
     setFormData(d);
   };
diff --git a/ui/src/utils/guard.ts b/ui/src/utils/guard.ts
index 3abf1054..5f2e7b52 100644
--- a/ui/src/utils/guard.ts
+++ b/ui/src/utils/guard.ts
@@ -144,10 +144,9 @@ export const pullLoggedUser = async (isInitPull = false) => {
   pluTimestamp = Date.now();
   const loggedUserInfo = await getLoggedUserInfo({
     passingError: true,
-  }).catch((ex) => {
+  }).catch(() => {
     pluTimestamp = 0;
     loggedUserInfoStore.getState().clear(false);
-    console.error(ex);
   });
   if (loggedUserInfo) {
     loggedUserInfoStore.getState().update(loggedUserInfo);
@@ -424,7 +423,6 @@ export const googleSnapshotRedirect = () => {
   if (searchStr.indexOf('cache:') === 0 && searchStr.includes(':http')) {
     const redirectUrl = `http${searchStr.split(':http')[1]}`;
     const pathname = redirectUrl.replace(new URL(redirectUrl).origin, '');
-    console.log('googleSnapshotUrl', window.location.href);
 
     gr.ok = false;
     gr.redirect = pathname || '/';
diff --git a/ui/src/utils/localize.ts b/ui/src/utils/localize.ts
index 850a1a2c..cfebb684 100644
--- a/ui/src/utils/localize.ts
+++ b/ui/src/utils/localize.ts
@@ -76,7 +76,7 @@ const addI18nResource = async (langName) => {
       const { default: resConf } = await import(`@i18n/${langName}.yaml`);
       res.resources = resConf.ui;
     } catch (ex) {
-      console.log('ex: ', ex);
+      console.error('addI18nResource error: ', ex);
     }
   } else if (storageResource && storageResource.lng === res.lng) {
     res.resources = storageResource.resources;
@@ -149,6 +149,5 @@ export const setupAppTimeZone = () => {
 
 export const setupAppTheme = () => {
   const theme = getCurrentTheme();
-  console.log(333, theme);
   changeTheme(theme);
 };