Mao 4 лет назад
Родитель
Сommit
71953f54e1

+ 0 - 12
packages/app/src/client/services/PageContainer.js

@@ -292,18 +292,6 @@ export default class PageContainer extends Container {
     await this.retrieveLikersAndSeenUsers();
   }
 
-  // this method is used only when like happend in normal page but not in search page.
-  // noraml page view use the states based on pageContainer but search page holds its own state in SearchResultSunNavButton.
-  async updateStateAfterLike() {
-    const toggledIsLiked = !this.state.isLiked;
-    await this.setState(state => ({
-      isLiked: toggledIsLiked,
-      sumOfLikers: toggledIsLiked ? state.sumOfLikers + 1 : state.sumOfLikers - 1,
-      likerIds: toggledIsLiked
-        ? [...this.state.likerIds, this.appContainer.currentUserId]
-        : state.likerIds.filter(id => id !== this.appContainer.currentUserId),
-    }));
-  }
 
   async retrieveLikersAndSeenUsers() {
     const { users } = await this.appContainer.apiGet('/users.list', { user_ids: [...this.state.likerIds, ...this.state.seenUserIds].join(',') });

+ 2 - 3
packages/app/src/components/SearchPage/SearchResultSubNavButton.tsx

@@ -1,12 +1,11 @@
 import React, {
-  FC, useState, useEffect,
+  FC,
 } from 'react';
 import AppContainer from '../../client/services/AppContainer';
 import { withUnstatedContainers } from '../UnstatedUtils';
 
 import PageReactionButtons from '../PageReactionButtons';
 import PageManagement from '../Page/PageManagement';
-import { apiv3Get } from '../../client/util/apiv3-client';
 
 
 type Props = {
@@ -33,7 +32,7 @@ const SearchResultSubNavButton : FC<Props> = (props: Props) => {
         TASK: https://estoc.weseek.co.jp/redmine/issues/81076
         CONDITION :isAbleToShowPageManagement = !isNotFoundPage && !isTrashPage && !isSharedUser
       */}
-      {/* if (CONDITION) then PageManagement */}
+      {/* if (CONDITION) then <PageManagement isCompactMode> */}
     </>
   );
 };