Fix bug in adding the Readwise connection, open Readwise API page in a new window.

This commit is contained in:
Jackson Harper
2022-10-28 17:47:02 +08:00
parent b8d70bcdb6
commit 8d46a39f51
3 changed files with 9 additions and 12 deletions

View File

@ -56,11 +56,11 @@ export function Readwise(): JSX.Element {
<Header>Readwise</Header>
</HStack>
{!isValidating && readwiseIntegration && (
{readwiseIntegration && (
<RemoveReadwiseForm integration={readwiseIntegration} revalidate={revalidate} />
)}
{!isValidating && !readwiseIntegration && (
{!readwiseIntegration && (
<AddReadwiseForm />
)}
@ -104,13 +104,14 @@ function AddReadwiseForm(): JSX.Element {
}}
>
<SpanBox>Enter your API key from Readwise below. You can get your token{' '}
<Link
<a
target='_blank'
referrerPolicy='no-referrer'
style={{ color: '$utilityTextDefault' }}
href="https://readwise.io/access_token"
target="_blank"
>
here
</Link>.</SpanBox>
</a>.</SpanBox>
</HStack>
<FormInput

View File

@ -14,12 +14,8 @@ type SetIntegrationResult = {
}
type SetIntegrationData = {
setIntegration?: SetIntegrationSuccess
errorCodes?: unknown[]
}
type SetIntegrationSuccess = {
integration: Integration
errorCodes?: unknown[]
}
type Integration = {
@ -64,5 +60,5 @@ export async function setIntegrationMutation(
throw 'Your token is invalid.'
throw error
}
return output.setIntegration?.setIntegration?.integration
return output.setIntegration?.integration
}

View File

@ -92,7 +92,7 @@ export default function Integrations(): JSX.Element {
},
{
icon: '/static/icons/readwise.svg',
title: 'ReadWise',
title: 'Readwise',
subText:
'Readwise makes it easy to revisit and learn from your ebook & article highlights. Use our Readwise integration to sync your highlights from Omnivore to Readwise.',
button: {