Mao 4 лет назад
Родитель
Сommit
9308b4d821

+ 4 - 4
packages/app/src/components/LikeButtons.jsx

@@ -34,7 +34,7 @@ class LikeButtons extends React.Component {
 
   async handleClick() {
     const {
-      appContainer, pageId, isLiked, onChnageInvoked,
+      appContainer, pageId, isLiked, onChangeInvoked,
     } = this.props;
     const { isGuestUser } = appContainer;
     if (isGuestUser) {
@@ -42,8 +42,8 @@ class LikeButtons extends React.Component {
     }
     try {
       await apiv3Put('/page/likes', { pageId, bool: isLiked });
-      if (onChnageInvoked !== null) {
-        onChnageInvoked();
+      if (onChangeInvoked !== null) {
+        onChangeInvoked();
       }
       else {
         return new Error('onChangeInvoked is null');
@@ -100,7 +100,7 @@ const LikeButtonsWrapper = withUnstatedContainers(LikeButtons, [AppContainer]);
 
 LikeButtons.propTypes = {
   appContainer: PropTypes.instanceOf(AppContainer).isRequired,
-  onChnageInvoked: PropTypes.func,
+  onChangeInvoked: PropTypes.func,
   pageId: PropTypes.string.isRequired,
   likers: PropTypes.arrayOf(PropTypes.object),
   sumOfLikers: PropTypes.number.isRequired,

+ 3 - 3
packages/app/src/components/Navbar/SubNavButtons.jsx

@@ -27,12 +27,12 @@ const SubnavButtons = (props) => {
       },
     } = pageContainer;
 
-    const onChangeInvoked = async() => {
+    const onChangeInvoked = () => {
       if (pageContainer.retrieveLikersAndSeenUsers == null) {
         logger.error('retrieveBookmarkInfo is null');
       }
       else {
-        await pageContainer.retrieveLikersAndSeenUsers();
+        pageContainer.retrieveLikersAndSeenUsers();
       }
     };
 
@@ -40,7 +40,7 @@ const SubnavButtons = (props) => {
       <>
         {pageContainer.isAbleToShowLikeButtons && (
           <span>
-            <LikeButtons onChangeInvoked={async() => { await onChangeInvoked() }} pageId={pageId} likers={likers} sumOfLikers={sumOfLikers} isLiked={isLiked} />
+            <LikeButtons onChangeInvoked={onChangeInvoked} pageId={pageId} likers={likers} sumOfLikers={sumOfLikers} isLiked={isLiked} />
           </span>
         )}
         <span>