Skip to content

Commit

Permalink
[field] PT: better resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
skogsmaskin authored and rexxars committed Oct 6, 2020
1 parent da4193e commit aa030e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react'
import {AnnotatedStringDiff, ArrayDiff, ObjectDiff, ObjectSchemaType, StringDiff} from '../../index'
import {AnnotatedStringDiff, ArrayDiff, ObjectDiff, StringDiff} from '../../index'
import {startCase} from 'lodash'
import {ChildMap, PortableTextBlock, PortableTextChild} from './types'
import {SchemaType} from '../../types'

export function isPTSchemaType(schemaType: ObjectSchemaType) {
export function isPTSchemaType(schemaType: SchemaType) {
return schemaType.jsonType === 'object' && schemaType.name === 'block'
}
export function isHeader(node: PortableTextBlock) {
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/field/src/diff/resolve/diffResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const diffResolver: DiffComponentResolver = function diffResolver({schema
return SlugFieldDiff
}

if (schemaType.jsonType === 'object' && isPTSchemaType(schemaType)) {
if (isPTSchemaType(schemaType)) {
return PTDiff
}

Expand Down

0 comments on commit aa030e1

Please sign in to comment.