Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/core/pluggableElementTypes/models/BaseTrackModel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy } from 'react'

import { types } from '@jbrowse/mobx-state-tree'
import { addDisposer, types } from '@jbrowse/mobx-state-tree'
import Save from '@mui/icons-material/Save'

import { ConfigurationReference, getConf } from '../../configuration'
Expand All @@ -19,6 +19,7 @@ import type {
} from '../../configuration'
import type { MenuItem } from '../../ui'
import type { IAnyStateTreeNode, Instance } from '@jbrowse/mobx-state-tree'
import { autorun } from 'mobx'

const SaveTrackDataDlg = lazy(() => import('./components/SaveTrackData'))

Expand Down Expand Up @@ -304,6 +305,20 @@ export function createBaseTrackModel(
: []),
]
},
afterAttach() {
addDisposer(
self,
autorun(() => {
if (!self.displays.length) {
const compatDisp = getCompatibleDisplays(self)
console.log({ compatDisp })
self.showDisplay(
self.configuration.trackId + '-' + compatDisp[0].type,
)
}
}),
)
},
}))
.postProcessSnapshot(snap => {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
Expand Down
Loading