Skip to content

Commit

Permalink
Cleanup lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 15, 2021
1 parent 9c58492 commit 11fe5d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 7 additions & 5 deletions plugins/linear-comparative-view/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import CalendarIcon from '@material-ui/icons/CalendarViewDay'
import { ConfigurationSchema, getConf } from '@jbrowse/core/configuration'
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'
import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
import SimpleFeature, { Feature } from '@jbrowse/core/util/simpleFeature'
import { Feature } from '@jbrowse/core/util/simpleFeature'
import {
createBaseTrackConfig,
createBaseTrackModel,
Expand Down Expand Up @@ -165,7 +165,7 @@ function WindowSizeDlg(props: {
const [window, setWindowSize] = useState('0')
const [error, setError] = useState<Error>()
const windowSize = +window
const [featureDownloaded, setFeatureDownloaded] = useState<Feature>()
const [primaryFeature, setPrimaryFeature] = useState<Feature>()
useEffect(() => {
let done = false
;(async () => {
Expand All @@ -188,8 +188,10 @@ function WindowSizeDlg(props: {
f => f.get('name') === preFeature.get('name'),
)
if (!done) {
setFeatureDownloaded(primaryFeat)
setPrimaryFeature(primaryFeat)
}
} else {
setPrimaryFeature(preFeature)
}
})()

Expand All @@ -200,7 +202,7 @@ function WindowSizeDlg(props: {

function onSubmit() {
try {
const feature = featureDownloaded || preFeature
const feature = primaryFeature || preFeature
const session = getSession(track)
const view = getContainingView(track)
const cigar = feature.get('CIGAR')
Expand Down Expand Up @@ -439,7 +441,7 @@ function WindowSizeDlg(props: {
</IconButton>
</DialogTitle>
<DialogContent>
{!featureDownloaded ? (
{!primaryFeature ? (
<div>
<Typography>
To accurately perform comparison we are fetching the primary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ import TextField from '@material-ui/core/TextField'

// core
import { getSession } from '@jbrowse/core/util'
import SimpleFeature, {
Feature,
SimpleFeatureSerialized,
} from '@jbrowse/core/util/simpleFeature'
import { Feature } from '@jbrowse/core/util/simpleFeature'
// other
import { formatSeqFasta, SeqChunk } from '@jbrowse/core/util/formatFastaStrings'
import { LinearGenomeViewModel } from '..'
Expand Down Expand Up @@ -80,10 +77,10 @@ async function fetchSequence(
sessionId,
}),
),
)) as SimpleFeatureSerialized[][]
)) as Feature[][]

// assumes that we get whole sequence in a single getFeatures call
return chunks.map(chunk => new SimpleFeature(chunk[0]))
return chunks.map(chunk => chunk[0])
}

function SequenceDialog({
Expand Down

0 comments on commit 11fe5d5

Please sign in to comment.