diff --git a/packages/web/components/patterns/CardMenu.tsx b/packages/web/components/patterns/CardMenu.tsx index 6a3c27dc0..23fb6e7bc 100644 --- a/packages/web/components/patterns/CardMenu.tsx +++ b/packages/web/components/patterns/CardMenu.tsx @@ -81,14 +81,14 @@ export function CardMenu(props: CardMenuProps): JSX.Element { }} title="Remove" /> - {!!props.item.subscription && ( + {/* {!!props.item.subscription && ( { props.actionHandler('unsubscribe') }} title="Unsubscribe" /> - )} + )} */} ) } diff --git a/packages/web/components/patterns/ConfirmationModal.tsx b/packages/web/components/patterns/ConfirmationModal.tsx index 25618fdbe..6e78b9566 100644 --- a/packages/web/components/patterns/ConfirmationModal.tsx +++ b/packages/web/components/patterns/ConfirmationModal.tsx @@ -21,10 +21,11 @@ type ConfirmationModalProps = { export function ConfirmationModal(props: ConfirmationModalProps): JSX.Element { const safeOnOpenChange = useCallback( (open: boolean) => { - props.onOpenChange(open) setTimeout(() => { + console.log('body style: ', document.body.style) document.body.style.removeProperty('pointer-events') }, 200) + props.onOpenChange(open) }, [props] ) diff --git a/packages/web/lib/networking/mutations/unsubscribeMutation.ts b/packages/web/lib/networking/mutations/unsubscribeMutation.ts index 24e2505e1..c1bcbd49f 100644 --- a/packages/web/lib/networking/mutations/unsubscribeMutation.ts +++ b/packages/web/lib/networking/mutations/unsubscribeMutation.ts @@ -12,12 +12,12 @@ type Unsubscribe = { } export async function unsubscribeMutation( - subscribeName: string, - id = '' + subscribtionName: string, + id: string ): Promise { const mutation = gql` - mutation { - unsubscribe(name: "${subscribeName}", subscriptionId: "${id}") { + mutation Unsubscribe($subscribtionName: String!, $subscriptionId: ID!) { + unsubscribe(name: $subscribtionName, subscriptionId: $subscriptionId) { ... on UnsubscribeSuccess { subscription { id @@ -31,7 +31,11 @@ export async function unsubscribeMutation( ` try { - const data = (await gqlFetcher(mutation)) as UnsubscribeResult + const data = (await gqlFetcher(mutation, { + subscriptionId: id, + subscribtionName: subscribtionName, + })) as UnsubscribeResult + return data.unsubscribe.errorCodes ? undefined : data.unsubscribe.subscription.id diff --git a/packages/web/lib/networking/queries/useGetLibraryItemsQuery.tsx b/packages/web/lib/networking/queries/useGetLibraryItemsQuery.tsx index f7fcad0d5..3434df3dc 100644 --- a/packages/web/lib/networking/queries/useGetLibraryItemsQuery.tsx +++ b/packages/web/lib/networking/queries/useGetLibraryItemsQuery.tsx @@ -413,27 +413,27 @@ export function useGetLibraryItemsQuery({ readingProgressAnchorIndex: 0, }) break - case 'unsubscribe': - if (!!item.node.subscription) { - updateData({ - cursor: item.cursor, - node: { - ...item.node, - subscription: undefined, - }, - }) - unsubscribeMutation(item.node.subscription).then((res) => { - if (res) { - showSuccessToast('Unsubscribed successfully', { - position: 'bottom-right', - }) - } else { - showErrorToast('Error unsubscribing', { - position: 'bottom-right', - }) - } - }) - } + // case 'unsubscribe': + // if (!!item.node.subscription) { + // updateData({ + // cursor: item.cursor, + // node: { + // ...item.node, + // subscription: undefined, + // }, + // }) + // unsubscribeMutation(item.node.subscription).then((res) => { + // if (res) { + // showSuccessToast('Unsubscribed successfully', { + // position: 'bottom-right', + // }) + // } else { + // showErrorToast('Error unsubscribing', { + // position: 'bottom-right', + // }) + // } + // }) + // } case 'update-item': updateData(item) break