Skip to content

Commit

Permalink
Re-arrange abortcontroller
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jun 28, 2022
1 parent adfcbc0 commit 9cd97b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/wiggle/src/LinearWiggleDisplay/models/model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,9 @@ const stateModelFactory = (
async reload() {
self.setError()
const aborter = new AbortController()
let stats
self.setLoading(aborter)
try {
stats = await getStats({
const stats = await getStats({
signal: aborter.signal,
...self.renderProps(),
})
Expand All @@ -561,9 +561,7 @@ const stateModelFactory = (
autorun(
async () => {
try {
const aborter = new AbortController()
const view = getContainingView(self) as LGV
self.setLoading(aborter)

if (!view.initialized) {
return
Expand All @@ -575,6 +573,8 @@ const stateModelFactory = (
if (self.regionTooLarge) {
return
}
const aborter = new AbortController()
self.setLoading(aborter)

const wiggleStats = await getStats({
signal: aborter.signal,
Expand Down

0 comments on commit 9cd97b3

Please sign in to comment.