Bladeren bron

取消阅读时间的权限设置

bding 3 maanden geleden
bovenliggende
commit
edd6c78228

+ 1 - 6
src/Collections/RecentInfo.tsx

@@ -78,12 +78,7 @@ const RecentInfo: React.FC<IRecentInfoProps> = props => {
           })
     }
   })
-  useTimeCount(
-    ArticleID || data?.Detail.ArticleId || 0,
-    'report',
-    (data?.HasPermission && data?.HasPermission === INewPermissionType.OK) || false,
-    1
-  )
+  useTimeCount(ArticleID || data?.Detail.ArticleId || 0, 'report', true, 1)
 
   // 补足表格
   const formatTable = (list: IListSubject[], index: number) => {

+ 1 - 6
src/Collections/ResearchSummary.tsx

@@ -88,12 +88,7 @@ const ResearchSummary: React.FC<IResearchSummaryProps> = props => {
       setDataDetail(res)
     }
   })
-  useTimeCount(
-    ArticleID || data?.List[0]?.ArticleId || 0,
-    'report',
-    (dataDetail?.HasPermission && dataDetail?.HasPermission === INewPermissionType.OK) || false,
-    menuID
-  )
+  useTimeCount(ArticleID || data?.List[0]?.ArticleId || 0, 'report', true, menuID)
 
   // 本周/上周切换
   const handleChangeSecondMenu = (key: string | number) => {

+ 1 - 5
src/Column/ColumnDetail.tsx

@@ -39,11 +39,7 @@ const ColumnDetail: React.FC<IColumnDetailProps> = props => {
     }
   })
   const media = useMedia()
-  useTimeCount(
-    props.articleId,
-    'column',
-    (data?.HasPermission && data?.HasPermission === INewPermissionType.OK) || false
-  )
+  useTimeCount(props.articleId, 'column', true)
   const handleToRefresh = () => {
     refreshArcticleDetail()
   }

+ 1 - 5
src/Material/MaterialInfo.tsx

@@ -85,11 +85,7 @@ const MaterialInfo: React.FC<IMaterialInfoProps> = props => {
     // eslint-disable-next-line react-hooks/exhaustive-deps
   }, [])
 
-  useTimeCount(
-    props.articleID,
-    'article',
-    (data?.HasPermission && data?.HasPermission === INewPermissionType.OK) || false
-  )
+  useTimeCount(props.articleID, 'article', true)
 
   const handleToApplyCollect = () => {
     applyCollect(props.articleID)

+ 2 - 0
src/Material/hooks/useTimeCount.tsx

@@ -99,6 +99,8 @@ const useTimeCount = (
   })
 
   useEffect(() => {
+    console.log(isOpenTimer, 'isOpenTimer')
+
     if (isOpenTimer) {
       handleCountTime()
       document.addEventListener('visibilitychange', handleChangeVisibility, false)