From 32888b07ce19831b7c831cd2ecb13a4897feb17a Mon Sep 17 00:00:00 2001 From: Calvin Lee Date: Fri, 8 Sep 2023 23:48:29 +0000 Subject: [PATCH] fix: [code-836]: fix issue where code comments cant be added (#420) --- web/src/components/DiffViewer/DiffViewerUtils.tsx | 3 ++- web/src/pages/Webhooks/Webhooks.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/components/DiffViewer/DiffViewerUtils.tsx b/web/src/components/DiffViewer/DiffViewerUtils.tsx index 03ac6d20f..ded5497dd 100644 --- a/web/src/components/DiffViewer/DiffViewerUtils.tsx +++ b/web/src/components/DiffViewer/DiffViewerUtils.tsx @@ -143,7 +143,8 @@ export function getCommentLineInfo( ) { const isSideBySideView = viewStyle === ViewStyle.SIDE_BY_SIDE const { left, lineNumber, filePath } = commentEntry - const filePathBody = contentDOM?.querySelector(`[data="${filePath}"`) + console.log(commentEntry) + const filePathBody = filePath ? contentDOM?.querySelector(`[data="${filePath}"`) : contentDOM const diffBody = filePathBody?.querySelector( `${isSideBySideView ? `.d2h-file-side-diff${left ? '.left' : '.right'} ` : ''}.d2h-diff-tbody` diff --git a/web/src/pages/Webhooks/Webhooks.tsx b/web/src/pages/Webhooks/Webhooks.tsx index ff2f725b0..fc360be03 100644 --- a/web/src/pages/Webhooks/Webhooks.tsx +++ b/web/src/pages/Webhooks/Webhooks.tsx @@ -286,7 +286,7 @@ export default function Webhooks() { showWhen={() => webhooks?.length === 0} forSearch={!!searchTerm} message={getString('webhookEmpty')} - buttonText={getString('createWebhook')} + buttonText={getString('newWebhook')} onButtonClick={() => history.push( routes.toCODEWebhookNew({