diff --git a/packages/web/lib/highlights/highlightGenerator.ts b/packages/web/lib/highlights/highlightGenerator.ts index 365f12367..3b2dfab1e 100644 --- a/packages/web/lib/highlights/highlightGenerator.ts +++ b/packages/web/lib/highlights/highlightGenerator.ts @@ -67,12 +67,16 @@ function nodeAttributesFromHighlight( const patch = highlight.patch const id = highlight.id const withNote = !!highlight.annotation - const customColor = !highlight.createdByMe - ? stringToColour(highlight.user.profile.username) - : undefined - const tooltip = !highlight.createdByMe - ? `Created by: @${highlight.user.profile.username}` - : undefined + const customColor = undefined + const tooltip = undefined + // We've disabled shared highlights, so passing undefined + // here now, and removing the user object from highlights + // !highlight.createdByMe + // ? stringToColour(highlight.user.profile.username) + // : undefined + // const tooltip = !highlight.createdByMe + // ? `Created by: @${highlight.user.profile.username}` + // : undefined return makeHighlightNodeAttributes(patch, id, withNote, customColor, tooltip) } diff --git a/packages/web/lib/networking/fragments/highlightFragment.ts b/packages/web/lib/networking/fragments/highlightFragment.ts index dd33cb455..2e8567bf5 100644 --- a/packages/web/lib/networking/fragments/highlightFragment.ts +++ b/packages/web/lib/networking/fragments/highlightFragment.ts @@ -9,18 +9,6 @@ export const highlightFragment = gql` suffix patch annotation - createdAt - updatedAt - sharedAt - user { - id - name - profile { - id - pictureUrl - username - } - } createdByMe } ` @@ -33,11 +21,7 @@ export type Highlight = { suffix?: string patch: string annotation?: string - createdAt: string - updatedAt: string - user: User createdByMe: boolean - sharedAt?: string } export type User = { diff --git a/packages/web/lib/networking/mutations/createHighlightMutation.ts b/packages/web/lib/networking/mutations/createHighlightMutation.ts index 364fb65d7..c0f9290e3 100644 --- a/packages/web/lib/networking/mutations/createHighlightMutation.ts +++ b/packages/web/lib/networking/mutations/createHighlightMutation.ts @@ -1,6 +1,6 @@ import { gql } from 'graphql-request' import { gqlFetcher } from '../networkHelpers' -import { Highlight } from './../fragments/highlightFragment' +import { Highlight, highlightFragment } from './../fragments/highlightFragment' export type CreateHighlightInput = { prefix: string @@ -28,7 +28,7 @@ export async function createHighlightMutation( createHighlight(input: $input) { ... on CreateHighlightSuccess { highlight { - ...NewHighlight + ...HighlightFields } } @@ -37,7 +37,7 @@ export async function createHighlightMutation( } } } - ${NewHighlightFragment} + ${highlightFragment} ` try { @@ -48,28 +48,3 @@ export async function createHighlightMutation( return undefined } } - -const NewHighlightFragment = gql` - fragment NewHighlight on Highlight { - id - shortId - quote - prefix - suffix - patch - createdAt - updatedAt - annotation - sharedAt - user { - id - name - profile { - id - pictureUrl - username - } - } - createdByMe - } -` diff --git a/packages/web/lib/networking/mutations/mergeHighlightMutation.ts b/packages/web/lib/networking/mutations/mergeHighlightMutation.ts index 76928de23..c157c28f8 100644 --- a/packages/web/lib/networking/mutations/mergeHighlightMutation.ts +++ b/packages/web/lib/networking/mutations/mergeHighlightMutation.ts @@ -41,15 +41,6 @@ export async function mergeHighlightMutation( updatedAt annotation sharedAt - user { - id - name - profile { - id - pictureUrl - username - } - } createdByMe } overlapHighlightIdList