Parcourir la source

don't let guest users click the button

Shun Miyazawa il y a 4 ans
Parent
commit
15482de59e
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      packages/app/src/components/SubscribeButton.tsx

+ 4 - 0
packages/app/src/components/SubscribeButton.tsx

@@ -20,6 +20,10 @@ const SubscruibeButton: FC<Props> = (props: Props) => {
   const [isWatching, setIsWatching] = useState(false);
 
   const handleClick = async() => {
+    if (appContainer.isGuestUser) {
+      return;
+    }
+
     try {
       const res = await appContainer.apiv3Put('page/subscribe', { pageId: pageContainer.state.pageId, status: !isWatching });
       if (res) {