Skip to content

Commit

Permalink
fix: uses _blank for Create links
Browse files Browse the repository at this point in the history
  • Loading branch information
snorrees committed Oct 21, 2024
1 parent c7e793c commit 36ac97b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {type ReactNode, useCallback, useState} from 'react'
import {Button} from '../../../ui-components'
import {useTranslation} from '../../i18n'
import {createLocaleNamespace} from '../i18n'
import {CREATE_LINK_TARGET} from '../start-in-create/StartInCreateDialog'
import {type CreateLinkedActionsProps} from '../types'
import {useCreateDocumentUrl} from '../useCreateDocumentUrl'
import {useSanityCreateTelemetry} from '../useSanityCreateTelemetry'
Expand Down Expand Up @@ -37,7 +36,7 @@ export function CreateLinkedActions(props: CreateLinkedActionsProps) {
mode="ghost"
paddingY={3}
href={href}
target={CREATE_LINK_TARGET}
target="_blank"
onClick={onEditInCreateClicked}
/>
<Button text={t('unlink-from-create-button.text')} paddingY={3} onClick={confirmUnlink} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import {getCreateLinkUrl} from '../useCreateDocumentUrl'
import {useGlobalUserId} from '../useGlobalUserId'
import {useSanityCreateTelemetry} from '../useSanityCreateTelemetry'

export const CREATE_LINK_TARGET = 'create'

export interface StartInCreateDialogProps {
createLinkId: string
appId: string
Expand Down Expand Up @@ -53,7 +51,7 @@ export function StartInCreateDialog(props: StartInCreateDialogProps) {
return
}

window?.open(createUrl, CREATE_LINK_TARGET)?.focus()
window?.open(createUrl, '_blank')?.focus()
onLinkingStarted(autoConfirm || dontShowAgain)
telemetry.startInCreateAccepted()
}, [createUrl, onLinkingStarted, pushToast, t, dontShowAgain, autoConfirm, telemetry])
Expand Down

0 comments on commit 36ac97b

Please sign in to comment.