From afaf6f29455ba50e003bb68ff792ce9774c56b69 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Mon, 4 Sep 2023 15:18:23 +0800 Subject: [PATCH] Remove some debug lines --- packages/web/components/patterns/ArticleNotes.tsx | 1 - packages/web/components/templates/ErrorLayout.tsx | 1 - packages/web/lib/hooks/useReaderSettings.tsx | 1 - .../networking/mutations/addPopularReadMutation.ts | 3 --- .../lib/networking/mutations/bulkActionMutation.ts | 3 --- .../mutations/createNewsletterEmailMutation.ts | 11 +++++++---- .../networking/mutations/createReminderMutation.ts | 8 ++++---- .../lib/networking/mutations/deleteAccountMutation.ts | 2 -- .../lib/networking/mutations/deleteRuleMutation.ts | 1 - .../mutations/importFromIntegrationMutation.ts | 1 - .../web/lib/networking/mutations/joinGroupMutation.ts | 3 --- .../networking/mutations/markEmailAsItemMutation.ts | 1 - .../lib/networking/mutations/setLabelsForHighlight.ts | 8 -------- .../lib/networking/mutations/updateLabelMutation.ts | 6 ++---- .../networking/mutations/uploadImportFileMutation.ts | 2 -- .../queries/useGetArticleOriginalHtmlQuery.tsx | 2 -- .../networking/queries/useGetIntegrationsQuery.tsx | 2 -- .../lib/networking/queries/useGetWebhooksQuery.tsx | 2 -- packages/web/pages/settings/api.tsx | 1 - 19 files changed, 13 insertions(+), 46 deletions(-) diff --git a/packages/web/components/patterns/ArticleNotes.tsx b/packages/web/components/patterns/ArticleNotes.tsx index 438e834ff..a4a786b99 100644 --- a/packages/web/components/patterns/ArticleNotes.tsx +++ b/packages/web/components/patterns/ArticleNotes.tsx @@ -25,7 +25,6 @@ MdEditor.use(Plugins.TabInsert, { tabMapValue: 1, // note that 1 means a '\t' instead of ' '. }) -console.log() MdEditor.use(Counter) type NoteSectionProps = { diff --git a/packages/web/components/templates/ErrorLayout.tsx b/packages/web/components/templates/ErrorLayout.tsx index b0837c883..b3370b928 100644 --- a/packages/web/components/templates/ErrorLayout.tsx +++ b/packages/web/components/templates/ErrorLayout.tsx @@ -13,7 +13,6 @@ type ErrorLayoutProps = { export function ErrorLayout(props: ErrorLayoutProps): JSX.Element { const { viewerData } = useGetViewerQuery() - console.log(viewerData?.me) return ( diff --git a/packages/web/lib/hooks/useReaderSettings.tsx b/packages/web/lib/hooks/useReaderSettings.tsx index 6c7c278d3..9a77c4042 100644 --- a/packages/web/lib/hooks/useReaderSettings.tsx +++ b/packages/web/lib/hooks/useReaderSettings.tsx @@ -99,7 +99,6 @@ export const useReaderSettings = (): ReaderSettings => { break case 'setMarginWidth': { const value = Number(arg) - console.log('setMarginWidth: ', value) if (value >= 200 && value <= 560) { setMarginWidth(value) } diff --git a/packages/web/lib/networking/mutations/addPopularReadMutation.ts b/packages/web/lib/networking/mutations/addPopularReadMutation.ts index 2ab326d3b..c8914e7b5 100644 --- a/packages/web/lib/networking/mutations/addPopularReadMutation.ts +++ b/packages/web/lib/networking/mutations/addPopularReadMutation.ts @@ -26,11 +26,8 @@ export async function addPopularReadMutation( } ` - console.log('addPopularReadMutation', mutation) - try { const response = await gqlFetcher(mutation, { readName }) - console.log('response', response) const data = response as AddPopularReadResponse | undefined return data?.addPopularRead?.pageId } catch (error) { diff --git a/packages/web/lib/networking/mutations/bulkActionMutation.ts b/packages/web/lib/networking/mutations/bulkActionMutation.ts index c1070ccec..71d02a281 100644 --- a/packages/web/lib/networking/mutations/bulkActionMutation.ts +++ b/packages/web/lib/networking/mutations/bulkActionMutation.ts @@ -45,8 +45,6 @@ export async function bulkActionMutation( } ` - console.log('bulkActionbulkActionMutation', mutation) - try { const response = await gqlFetcher(mutation, { action, @@ -54,7 +52,6 @@ export async function bulkActionMutation( labelIds, expectedCount, }) - console.log('response', response) const data = response as BulkActionResponse | undefined return data?.bulkAction?.success ?? false } catch (error) { diff --git a/packages/web/lib/networking/mutations/createNewsletterEmailMutation.ts b/packages/web/lib/networking/mutations/createNewsletterEmailMutation.ts index e56d58427..ba7d46ab6 100644 --- a/packages/web/lib/networking/mutations/createNewsletterEmailMutation.ts +++ b/packages/web/lib/networking/mutations/createNewsletterEmailMutation.ts @@ -11,7 +11,9 @@ type CreateNewsletterEmail = { newsletterEmail: NewsletterEmail } -export async function createNewsletterEmailMutation(): Promise { +export async function createNewsletterEmailMutation(): Promise< + string | undefined +> { const mutation = gql` mutation createNewsletterEmailMutation { createNewsletterEmail { @@ -29,9 +31,10 @@ export async function createNewsletterEmailMutation(): Promise { + sendNotification: boolean +): Promise { const mutation = gql` mutation createReminderMutation($input: CreateReminderInput!) { createReminder(input: $input) { @@ -35,13 +36,12 @@ export async function createReminderMutation( reminderType, archiveUntil, sendNotification, - scheduledAt: new Date() + scheduledAt: new Date(), } const data = await gqlFetcher(mutation, { input }) - console.log('created reminder', data) return 'data' } catch (error) { console.log('createReminder error', error) return undefined } -} \ No newline at end of file +} diff --git a/packages/web/lib/networking/mutations/deleteAccountMutation.ts b/packages/web/lib/networking/mutations/deleteAccountMutation.ts index 15c6a6f6e..d65c3f4f7 100644 --- a/packages/web/lib/networking/mutations/deleteAccountMutation.ts +++ b/packages/web/lib/networking/mutations/deleteAccountMutation.ts @@ -26,8 +26,6 @@ export async function deleteAccountMutation( } ` - console.log('deleteAccountMutation', mutation) - try { const response = await gqlFetcher(mutation, { userId }) console.log('response', response) diff --git a/packages/web/lib/networking/mutations/deleteRuleMutation.ts b/packages/web/lib/networking/mutations/deleteRuleMutation.ts index 0e36bad2a..b41e4cc5b 100644 --- a/packages/web/lib/networking/mutations/deleteRuleMutation.ts +++ b/packages/web/lib/networking/mutations/deleteRuleMutation.ts @@ -35,7 +35,6 @@ export async function deleteRuleMutation(id: string): Promise { const data = (await gqlFetcher(mutation, { id })) as DeleteRuleResult const output = data as any const error = data.deleteRule?.errorCodes?.find(() => true) - console.log('DATA: ', output.deleteRule) if (error) { throw error } diff --git a/packages/web/lib/networking/mutations/importFromIntegrationMutation.ts b/packages/web/lib/networking/mutations/importFromIntegrationMutation.ts index e74b5429b..0d14dba25 100644 --- a/packages/web/lib/networking/mutations/importFromIntegrationMutation.ts +++ b/packages/web/lib/networking/mutations/importFromIntegrationMutation.ts @@ -25,7 +25,6 @@ export async function importFromIntegrationMutation( }` const data = await gqlFetcher(mutation, { integrationId }) - console.log('integrationId: ', data) const output = data as ImportFromIntegrationDataResponseData | undefined const error = output?.importFromIntegration?.errorCodes?.find(() => true) console.log('error: ', error) diff --git a/packages/web/lib/networking/mutations/joinGroupMutation.ts b/packages/web/lib/networking/mutations/joinGroupMutation.ts index 86c7b9000..30d18be36 100644 --- a/packages/web/lib/networking/mutations/joinGroupMutation.ts +++ b/packages/web/lib/networking/mutations/joinGroupMutation.ts @@ -38,10 +38,7 @@ export async function joinGroupMutation( } ` - console.log('JoinGroupMutation', mutation) - const response = await gqlFetcher(mutation, { inviteCode }) - console.log(' -- response', response) const data = response as JoinGroupResponse | undefined const error = data?.errorCodes?.find(() => true) if (error) { diff --git a/packages/web/lib/networking/mutations/markEmailAsItemMutation.ts b/packages/web/lib/networking/mutations/markEmailAsItemMutation.ts index fc6e60690..c54a12726 100644 --- a/packages/web/lib/networking/mutations/markEmailAsItemMutation.ts +++ b/packages/web/lib/networking/mutations/markEmailAsItemMutation.ts @@ -25,7 +25,6 @@ export async function markEmailAsItemMutation( }` const data = await gqlFetcher(mutation, { recentEmailId }) - console.log('recentEmailId: ', data) const output = data as MarkEmailAsItemDataResponseData | undefined const error = output?.markEmailAsItem?.errorCodes?.find(() => true) console.log('error: ', error) diff --git a/packages/web/lib/networking/mutations/setLabelsForHighlight.ts b/packages/web/lib/networking/mutations/setLabelsForHighlight.ts index a2c4521eb..b1f25f76a 100644 --- a/packages/web/lib/networking/mutations/setLabelsForHighlight.ts +++ b/packages/web/lib/networking/mutations/setLabelsForHighlight.ts @@ -31,18 +31,10 @@ export async function setLabelsForHighlight( ${labelFragment} ` - console.log( - 'setting label for highlight id: ', - highlightId, - 'labelIds', - labelIds - ) - try { const data = (await gqlFetcher(mutation, { input: { highlightId, labelIds }, })) as SetLabelsForHighlightResult - console.log(' -- errorCodes', data.setLabelsForHighlight.errorCodes) return data.setLabelsForHighlight.errorCodes ? undefined diff --git a/packages/web/lib/networking/mutations/updateLabelMutation.ts b/packages/web/lib/networking/mutations/updateLabelMutation.ts index d05f11b35..07e6cdbc8 100644 --- a/packages/web/lib/networking/mutations/updateLabelMutation.ts +++ b/packages/web/lib/networking/mutations/updateLabelMutation.ts @@ -3,8 +3,8 @@ import { gqlFetcher } from '../networkHelpers' export type UpdateLabelInput = { labelId: string - name: string, - color: string, + name: string + color: string description?: string } @@ -39,9 +39,7 @@ export async function updateLabelMutation( try { const data = await gqlFetcher(mutation) - console.log(input, data); const output = data as any - console.log(output) return output?.updatedLabel } catch (err) { return undefined diff --git a/packages/web/lib/networking/mutations/uploadImportFileMutation.ts b/packages/web/lib/networking/mutations/uploadImportFileMutation.ts index 055fe9078..aac8e9675 100644 --- a/packages/web/lib/networking/mutations/uploadImportFileMutation.ts +++ b/packages/web/lib/networking/mutations/uploadImportFileMutation.ts @@ -32,10 +32,8 @@ export async function uploadImportFileRequestMutation( }` const data = await gqlFetcher(mutation, { type, contentType }) - console.log('UploadImportFile: ', data) const output = data as UploadImportFileResponseData | undefined const error = output?.uploadImportFile?.errorCodes?.find(() => true) - console.log('error: ', error) if (error) { throw error } diff --git a/packages/web/lib/networking/queries/useGetArticleOriginalHtmlQuery.tsx b/packages/web/lib/networking/queries/useGetArticleOriginalHtmlQuery.tsx index c12443eec..edee9e662 100644 --- a/packages/web/lib/networking/queries/useGetArticleOriginalHtmlQuery.tsx +++ b/packages/web/lib/networking/queries/useGetArticleOriginalHtmlQuery.tsx @@ -53,8 +53,6 @@ export function useGetArticleOriginalHtmlQuery({ ) const resultData: ArticleData | undefined = data as ArticleData - console.log('RESULT', JSON.stringify(data)) - return resultData?.article.article.originalHtml } diff --git a/packages/web/lib/networking/queries/useGetIntegrationsQuery.tsx b/packages/web/lib/networking/queries/useGetIntegrationsQuery.tsx index 711079bae..9c28e2505 100644 --- a/packages/web/lib/networking/queries/useGetIntegrationsQuery.tsx +++ b/packages/web/lib/networking/queries/useGetIntegrationsQuery.tsx @@ -53,8 +53,6 @@ export function useGetIntegrationsQuery(): IntegrationsQueryResponse { ` const { data, mutate, isValidating } = useSWR(query, publicGqlFetcher) - console.log('integrations data', data) - try { if (data) { const result = data as IntegrationsQueryResponseData diff --git a/packages/web/lib/networking/queries/useGetWebhooksQuery.tsx b/packages/web/lib/networking/queries/useGetWebhooksQuery.tsx index 2fa16675b..ea97cd71d 100644 --- a/packages/web/lib/networking/queries/useGetWebhooksQuery.tsx +++ b/packages/web/lib/networking/queries/useGetWebhooksQuery.tsx @@ -62,8 +62,6 @@ export function useGetWebhooksQuery(): WebhooksQueryResponse { ` const { data, mutate, isValidating } = useSWR(query, publicGqlFetcher) - console.log('webhooks data', data) - try { if (data) { const result = data as WebhooksQueryResponseData diff --git a/packages/web/pages/settings/api.tsx b/packages/web/pages/settings/api.tsx index 0fc32d02e..d728bf74f 100644 --- a/packages/web/pages/settings/api.tsx +++ b/packages/web/pages/settings/api.tsx @@ -65,7 +65,6 @@ export default function Api(): JSX.Element { name: 'expiredAt', required: true, onChange: (e) => { - console.log('onChange: ', e) let additionalDays = 0 switch (e.target.value) { case 'in 7 days':