Skip to content

Commit cd17c6b

Browse files
remove a bunch of console.log(s and add ? to optional values
1 parent ff55943 commit cd17c6b

File tree

10 files changed

+5
-26
lines changed

10 files changed

+5
-26
lines changed

src/common-ui/components/dropdown-menu-small.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ export class DropdownMenuBtn extends React.PureComponent<Props, State> {
108108
// })
109109
// }
110110

111-
console.log('items', this.props.menuItems)
112-
113111
return (
114112
<MenuItemContainerUnfolded isOpen={this.state.isOpened}>
115113
{this.props.menuItems.map((item) => (

src/content-scripts/content_script/global.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,6 @@ export async function main(
717717
)
718718
await createPromise
719719
} else if (window.location.href.includes('youtube.com')) {
720-
console.log('commentText', commentText)
721720
await inPageUI.showSidebar({
722721
action: 'youtube_timestamp',
723722
commentText: commentText,

src/content-sharing/background/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ export default class ContentSharingBackground {
630630
return null
631631
}
632632

633-
return contents.remoteId
633+
return contents?.remoteId
634634
}
635635

636636
ensureRemotePageId: ContentSharingInterface['ensureRemotePageId'] = async (

src/dashboard-refactor/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export class DashboardContainer extends StatefulUIElement<
187187
const listData = getListData(listsSidebar.selectedListId, {
188188
listsSidebar,
189189
})
190-
const remoteLink = listData.remoteId
190+
const remoteLink = listData?.remoteId
191191
? getListShareUrl({ remoteListId: listData.remoteId })
192192
: undefined // TODO: ensure this comes with key for collab'd lists
193193
const isOwnedList = listData.creator?.id === currentUser?.id

src/search-injection/content_script.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ export async function initSearchInjection({
4141
try {
4242
const query = utils.fetchQuery(url)
4343

44-
console.log('SearchInjection: Fetching search query', query)
45-
4644
await handleRenderSearchInjection(
4745
query,
4846
requestSearcher,

src/search-injection/searchInjection.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ export const handleRenderSearchInjection = async (
120120
// Calls renderComponent to render the react component
121121

122122
const renderComponent = async () => {
123-
console.log('redering search injection')
124123
// Accesses docs, totalCount from parent through closure
125124
// Gets position from settings
126125
// Renders React Component on the respective container
@@ -331,7 +330,6 @@ export const handleRenderSearchInjection = async (
331330
})
332331

333332
if (isTargetNodeAdded) {
334-
console.log('render2')
335333
renderComponent()
336334
}
337335
}
@@ -346,7 +344,6 @@ export const handleRenderSearchInjection = async (
346344
)
347345

348346
if (targetNode && !existingInjection) {
349-
console.log('render1')
350347
renderComponent()
351348
} else {
352349
// Configuration for the observer (which mutations to observe)

src/search-injection/youtubeInterface.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,9 @@ export function injectYoutubeContextMenu(annotationsFunctions: any) {
273273
'ytp-popup ytp-contextmenu',
274274
)
275275
if (contextMenu.length > 0) {
276-
console.log('contextMenu', contextMenu)
277276
panel = contextMenu[0]?.querySelector('.ytp-panel-menu')
278-
279-
console.log('panel', panel)
280277
}
281278
if (panel) {
282-
console.log('panel', panel)
283279
renderYoutubeMenuButton(panel, annotationsFunctions, icon)
284280
return
285281
}
@@ -289,10 +285,8 @@ export function injectYoutubeContextMenu(annotationsFunctions: any) {
289285
const targetElement = targetObject.target as HTMLElement
290286
if (targetElement.classList.contains('ytp-contextmenu')) {
291287
const targetChildren = targetElement.children
292-
console.log('targetChildren', targetChildren)
293288

294289
for (let i = 0; i < targetChildren.length; i++) {
295-
console.log('targetChildren[i]', targetChildren[i])
296290
if (targetChildren[i].classList.contains('ytp-panel')) {
297291
const potentialPanel = targetChildren[i].querySelector(
298292
'.ytp-panel-menu',

src/sidebar/annotations-sidebar/components/AnnotationsSidebar.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,8 +1895,6 @@ export class AnnotationsSidebar extends React.Component<
18951895
)
18961896
}
18971897

1898-
console.log('this.props.', this.props.hasKey)
1899-
19001898
return (
19011899
<AISidebarContainer>
19021900
{this.props.sidebarContext === 'in-page' &&

src/sidebar/annotations-sidebar/containers/logic.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -857,16 +857,13 @@ export class SidebarContainerLogic extends UILogic<
857857
const openAIKey = await this.syncSettings.openAI.get('apiKey')
858858
const hasAPIKey = openAIKey && openAIKey.trim().startsWith('sk-')
859859

860-
console.log('openAIKey', '"', openAIKey.trim(), '"')
861860
this.emitMutation({
862861
hasKey: { $set: hasAPIKey },
863862
})
864863
const signupDate = new Date(
865864
await (await this.options.authBG.getCurrentUser()).creationTime,
866865
).getTime()
867866

868-
console.log('signupDate', signupDate)
869-
870867
this.emitMutation({
871868
signupDate: { $set: signupDate },
872869
isTrial: { $set: await enforceTrialPeriod30Days(signupDate) },
@@ -2568,7 +2565,7 @@ export class SidebarContainerLogic extends UILogic<
25682565
{
25692566
comment: existing.comment,
25702567
body: existing.body,
2571-
remoteId: sharingState.remoteId
2568+
remoteId: sharingState?.remoteId
25722569
? sharingState.remoteId.toString()
25732570
: existing.remoteId,
25742571
unifiedId: event.unifiedAnnotationId,
@@ -2947,8 +2944,6 @@ export class SidebarContainerLogic extends UILogic<
29472944
await this.updateSuggestionResults(results)
29482945
}
29492946

2950-
console.log('model', previousState.AImodel)
2951-
29522947
const response = await this.options.summarizeBG.startPageSummaryStream({
29532948
fullPageUrl:
29542949
isPagePDF || previousState.fetchLocalHTML
@@ -4722,7 +4717,7 @@ export class SidebarContainerLogic extends UILogic<
47224717
.filter((id) => !!id)
47234718

47244719
annotationsCache.updateAnnotation({
4725-
remoteId: sharingState.remoteId
4720+
remoteId: sharingState?.remoteId
47264721
? sharingState.remoteId.toString()
47274722
: undefined,
47284723
unifiedId: annotation.unifiedId,

0 commit comments

Comments
 (0)