Skip to content
Merged
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
13 changes: 6 additions & 7 deletions packages/jbrowse-plugin-apollo/src/session/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,23 +411,22 @@ export function extendSession(
}))

.views((self) => {
const superTrackActionMenuItems = (
self as unknown as AbstractSessionModel
).getTrackActionMenuItems
const superTrackActions = (self as unknown as AbstractSessionModel)
.getTrackActions
return {
getTrackActionMenuItems(conf: BaseTrackConfig) {
getTrackActions(conf: BaseTrackConfig) {
if (
conf.type === 'ApolloTrack' ||
conf.type === 'ReferenceSequenceTrack'
) {
return superTrackActionMenuItems?.(conf)
return superTrackActions?.(conf)
}
const trackId = readConfObject(conf, 'trackId') as string
const sessionTrackIdentifier = '-sessionTrack'
const isSessionTrack = trackId.endsWith(sessionTrackIdentifier)
return isSessionTrack
? [
...(superTrackActionMenuItems?.(conf) ?? []),
...(superTrackActions?.(conf) ?? []),
{
label: 'Save track to Apollo',
onClick: async () => {
Expand Down Expand Up @@ -480,7 +479,7 @@ export function extendSession(
},
]
: [
...(superTrackActionMenuItems?.(conf) ?? []),
...(superTrackActions?.(conf) ?? []),
{
label: 'Remove track from Apollo',
onClick: async () => {
Expand Down
Loading