diff --git a/src/core/client/auth/test/__snapshots__/forgotPassword.spec.tsx.snap b/src/core/client/auth/test/__snapshots__/forgotPassword.spec.tsx.snap index b80886701..fa98c6ce7 100644 --- a/src/core/client/auth/test/__snapshots__/forgotPassword.spec.tsx.snap +++ b/src/core/client/auth/test/__snapshots__/forgotPassword.spec.tsx.snap @@ -34,7 +34,6 @@ exports[`renders forgot password view 1`] = ` onMouseOut={[Function]} onMouseOver={[Function]} onTouchEnd={[Function]} - type="button" > Go back to sign in page diff --git a/src/core/client/auth/test/__snapshots__/signIn.spec.tsx.snap b/src/core/client/auth/test/__snapshots__/signIn.spec.tsx.snap index 475ebfdac..4e15c05b3 100644 --- a/src/core/client/auth/test/__snapshots__/signIn.spec.tsx.snap +++ b/src/core/client/auth/test/__snapshots__/signIn.spec.tsx.snap @@ -108,7 +108,6 @@ exports[`auth configuration renders all auth enabled 1`] = ` onMouseOut={[Function]} onMouseOver={[Function]} onTouchEnd={[Function]} - type="button" > Forgot your password? @@ -373,7 +372,6 @@ exports[`renders sign in view 1`] = ` onMouseOut={[Function]} onMouseOver={[Function]} onTouchEnd={[Function]} - type="button" > Sign up @@ -486,7 +484,6 @@ exports[`renders sign in view 1`] = ` onMouseOut={[Function]} onMouseOver={[Function]} onTouchEnd={[Function]} - type="button" > Forgot your password? diff --git a/src/core/client/auth/test/__snapshots__/signUp.spec.tsx.snap b/src/core/client/auth/test/__snapshots__/signUp.spec.tsx.snap index 2615667cc..23cc3e561 100644 --- a/src/core/client/auth/test/__snapshots__/signUp.spec.tsx.snap +++ b/src/core/client/auth/test/__snapshots__/signUp.spec.tsx.snap @@ -390,7 +390,6 @@ exports[`renders sign up form 1`] = ` onMouseOut={[Function]} onMouseOver={[Function]} onTouchEnd={[Function]} - type="button" > Sign in diff --git a/src/core/client/stream/tabs/Comments/Comment/CommentContainer.tsx b/src/core/client/stream/tabs/Comments/Comment/CommentContainer.tsx index 268b5a88a..6390a7071 100644 --- a/src/core/client/stream/tabs/Comments/Comment/CommentContainer.tsx +++ b/src/core/client/stream/tabs/Comments/Comment/CommentContainer.tsx @@ -130,23 +130,24 @@ export const CommentContainer: FunctionComponent = ({ from: "COMMENT_STREAM", }); + // If the feature for read more new tab is enabled, then redirect the + // user. + + // If the feature flag for opening this in a new tab is enabled, then we + // don't need to do anything! + if (settings.featureFlags.includes(GQLFEATURE_FLAG.READ_MORE_NEW_TAB)) { + return; + } + // Prevent the event from acting. e.preventDefault(); - // If the feature for read more new tab is enabled, then redirect the - // user. - if (settings.featureFlags.includes(GQLFEATURE_FLAG.READ_MORE_NEW_TAB)) { - const url = getURLWithCommentID(story.url, comment.id); + // Update the current view to show the comment. + void setCommentID({ id: comment.id }); - window.open(url, "_blank", "noreferrer"); - } else { - void setCommentID({ id: comment.id }); - } - - // Return false to prevent the navigation from occuring. return false; }, - [eventEmitter, comment.id, settings.featureFlags, story.url, setCommentID] + [eventEmitter, comment.id, settings.featureFlags, setCommentID] ); const isLoggedIn = !!viewer; diff --git a/src/core/client/stream/tabs/Comments/Comment/ShowConversationLink.tsx b/src/core/client/stream/tabs/Comments/Comment/ShowConversationLink.tsx index 926c6b0da..3c0456635 100644 --- a/src/core/client/stream/tabs/Comments/Comment/ShowConversationLink.tsx +++ b/src/core/client/stream/tabs/Comments/Comment/ShowConversationLink.tsx @@ -29,7 +29,7 @@ const ShowConversationLink: FunctionComponent = ( mouseHover: styles.mouseHover, disabled: styles.disabled, }), - [styles] + [] ); return ( @@ -42,7 +42,7 @@ const ShowConversationLink: FunctionComponent = ( classes={classesOverride} href={props.href} onClick={props.onClick} - target="_parent" + target="_blank" anchor > Read More of this Conversation > diff --git a/src/core/client/stream/tabs/Comments/Comment/__snapshots__/ShowConversationLink.spec.tsx.snap b/src/core/client/stream/tabs/Comments/Comment/__snapshots__/ShowConversationLink.spec.tsx.snap index 38b6a006a..b0025809f 100644 --- a/src/core/client/stream/tabs/Comments/Comment/__snapshots__/ShowConversationLink.spec.tsx.snap +++ b/src/core/client/stream/tabs/Comments/Comment/__snapshots__/ShowConversationLink.spec.tsx.snap @@ -20,7 +20,7 @@ exports[`renders correctly 1`] = ` href="http://localhost/comment" id="id" onClick={[Function]} - target="_parent" + target="_blank" variant="textUnderlined" > Read More of this Conversation > diff --git a/src/core/client/stream/test/comments/featured/__snapshots__/renderFeaturedStream.spec.tsx.snap b/src/core/client/stream/test/comments/featured/__snapshots__/renderFeaturedStream.spec.tsx.snap index f6ea3b246..d9be6a837 100644 --- a/src/core/client/stream/test/comments/featured/__snapshots__/renderFeaturedStream.spec.tsx.snap +++ b/src/core/client/stream/test/comments/featured/__snapshots__/renderFeaturedStream.spec.tsx.snap @@ -531,7 +531,6 @@ exports[`renders comment stream 1`] = ` onMouseOut={[Function]} onMouseOver={[Function]} onTouchEnd={[Function]} - type="button" >