Explorar o código

switch isSubscribing status

kaori %!s(int64=4) %!d(string=hai) anos
pai
achega
14c60195fc
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      packages/app/src/components/SubscribeButton.tsx

+ 5 - 1
packages/app/src/components/SubscribeButton.tsx

@@ -56,7 +56,11 @@ const SubscribeButton: FC<Props> = (props: Props) => {
     return <></>;
     return <></>;
   }
   }
 
 
-  const isSubscribing = subscriptionData.status === SubscribeStatuses.STATUS_SUBSCRIBE;
+  let isSubscribing;
+
+  if (subscriptionData.status) {
+    isSubscribing = true;
+  }
 
 
   const buttonClass = `${isSubscribing ? 'active' : ''} ${appContainer.isGuestUser ? 'disabled' : ''}`;
   const buttonClass = `${isSubscribing ? 'active' : ''} ${appContainer.isGuestUser ? 'disabled' : ''}`;
   const iconClass = isSubscribing || isSubscribing == null ? 'fa fa-eye' : 'fa fa-eye-slash';
   const iconClass = isSubscribing || isSubscribing == null ? 'fa fa-eye' : 'fa fa-eye-slash';