Skip to content

Commit

Permalink
Fix opening .jbrowse files on desktop (#4590)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin authored Sep 25, 2024
1 parent a020505 commit 8d49fdd
Show file tree
Hide file tree
Showing 8 changed files with 384 additions and 371 deletions.
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export default tseslint.config(
'unicorn/prefer-string-replace-all': 'off',
'unicorn/no-array-reduce': 'off',

'@typescript-eslint/no-deprecated': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const OldHydrate = observer(function OldHydrate(props: Props) {
function doHydrate() {
if (domNode && html) {
if (domNode.innerHTML) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
unmountComponentAtNode(domNode)
}

Expand All @@ -81,15 +80,13 @@ const OldHydrate = observer(function OldHydrate(props: Props) {
// hydration for when we have some free time. helps keep the
// framerate up.
rIC(() => {
// eslint-disable-next-line @typescript-eslint/no-deprecated
hydrate(<RenderingComponent {...props} />, domNode)
})
}
}
doHydrate()
return () => {
if (domNode) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
unmountComponentAtNode(domNode)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ const OldHydrate = observer(function ({
const domNode = ref.current
function doHydrate() {
if (domNode) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
unmountComponentAtNode(domNode)
domNode.innerHTML = html

rIC(() => {
// eslint-disable-next-line @typescript-eslint/no-deprecated
hydrate(
<ThemeProvider theme={jbrowseTheme}>
<RenderingComponent {...rest} />
Expand All @@ -102,7 +100,6 @@ const OldHydrate = observer(function ({

return () => {
if (domNode) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
unmountComponentAtNode(domNode)
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/core/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,6 @@ export function renderToStaticMarkup(
if (createRootFn) {
createRootFn(div).render(node)
} else {
// eslint-disable-next-line @typescript-eslint/no-deprecated
render(node, div)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export default function AutocompleteTextField({
setInputValue: (arg: string) => void
setCurrentSearch: (arg: string) => void
}) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
const { helperText, InputProps = {} } = TextFieldProps
return (
<TextField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function recordStats(event, context, done) {
stats.referer = headers.Referer || headers.referer || null
stats.acceptLanguage = headers['Accept-Language'] || null
stats.acceptCharset = headers['Accept-Charset'] || null
// eslint-disable-next-line @typescript-eslint/no-deprecated

stats.host = stats.referer ? url_parser.parse(stats.referer).host : null
if (stats.host?.startsWith('www.')) {
stats.host = stats.host.slice(4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,17 @@ export default function RecentSessionPanel({
value="quickstart"
title="Add sessions to quickstart list"
disabled={!selectedSessions?.length}
onClick={() => addToQuickstartList(selectedSessions || [])}
onClick={() => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
;(async () => {
try {
await addToQuickstartList(selectedSessions || [])
} catch (e) {
setError(e)
console.error(e)
}
})()
}}
>
<PlaylistAddIcon />
</ToggleButtonWithTooltip>
Expand Down Expand Up @@ -196,7 +206,8 @@ export default function RecentSessionPanel({
try {
const file = target.files?.[0]
if (file) {
const path = (file as File & { path: string }).path
const { webUtils } = window.require('electron')
const path = webUtils.getPathForFile(file)
setPluginManager(await loadPluginManager(path))
}
} catch (e) {
Expand Down
Loading

0 comments on commit 8d49fdd

Please sign in to comment.