Skip to content

Commit

Permalink
Add warning for JSON session if it contains callbacks (#1760)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin authored Mar 3, 2021
1 parent c61bdd4 commit 6f27b40
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion products/jbrowse-web/src/Loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,12 @@ const SessionLoader = types
async decodeJsonUrlSession() {
// @ts-ignore
const session = JSON.parse(self.sessionQuery.replace('json-', ''))
self.setSessionSnapshot({ ...session, id: shortid() })
const hasCallbacks = await scanSharedSessionForCallbacks(session)
if (hasCallbacks) {
self.setSessionTriaged({ snap: session, origin: 'share' })
} else {
self.setSessionSnapshot({ ...session, id: shortid() })
}
},

async afterCreate() {
Expand Down

0 comments on commit 6f27b40

Please sign in to comment.