Merge pull request #2358 from omnivore-app/feat/api-reduce-events

feat/api reduce events
This commit is contained in:
Hongbo Wu 2023-06-14 13:36:39 +08:00 committed by GitHub
commit 42465828ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 36 deletions

View file

@ -438,15 +438,6 @@ export const getArticleResolver: ResolverFn<
format === ArticleFormat.Distiller ||
!!graphqlFields(info).article.originalHtml
analytics.track({
userId: claims?.uid,
event: 'link_fetched',
properties: {
slug,
env: env.server.apiEnv,
},
})
// We allow the backend to use the ID instead of a slug to fetch the article
const page =
(await getPageByParam(
@ -900,15 +891,6 @@ export const searchResolver = authorized<
const searchQuery = parseSearchQuery(params.query || undefined)
analytics.track({
userId: claims.uid,
event: 'search',
properties: {
env: env.server.apiEnv,
...searchQuery,
},
})
let results: SearchItemData[]
let totalCount: number
@ -1036,17 +1018,6 @@ export const updatesSinceResolver = authorized<
return { errorCodes: [UpdatesSinceErrorCode.Unauthorized] }
}
analytics.track({
userId: uid,
event: 'updatesSince',
properties: {
env: env.server.apiEnv,
since,
first,
after,
},
})
const sort = sortParamsToElasticSort(sortParams)
const startCursor = after || ''

View file

@ -76,13 +76,15 @@ export function HighlightsLayer(props: HighlightsLayerProps): JSX.Element {
const focusedHighlightMousePos = useRef({ pageX: 0, pageY: 0 })
const [currentHighlightIdx, setCurrentHighlightIdx] = useState(0)
const [focusedHighlight, setFocusedHighlight] =
useState<Highlight | undefined>(undefined)
const [focusedHighlight, setFocusedHighlight] = useState<
Highlight | undefined
>(undefined)
const [selectionData, setSelectionData] = useSelection(highlightLocations)
const [labelsTarget, setLabelsTarget] =
useState<Highlight | undefined>(undefined)
const [labelsTarget, setLabelsTarget] = useState<Highlight | undefined>(
undefined
)
const createHighlightFromSelection = useCallback(
async (
@ -346,7 +348,6 @@ export function HighlightsLayer(props: HighlightsLayerProps): JSX.Element {
highlightModalAction: 'addComment',
})
} else {
console.log('sending page tapped')
window?.webkit?.messageHandlers.viewerAction?.postMessage({
actionID: 'pageTapped',
})

View file

@ -72,8 +72,6 @@ export function Notebook(props: NotebookProps): JSX.Element {
)
const [, updateState] = useState({})
console.log('props.showConfirmDeleteNote', props.showConfirmDeleteNote)
const annotationsReducer = (
state: AnnotationInfo,
action: {