Skip to content

Commit 6cf045f

Browse files
authored
Merge pull request #115 from Jacko1394/fix-hang-on-spinner
FIX: Indefinite fetch spinner
2 parents 439dc30 + 671e6e7 commit 6cf045f

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

app/src/lib/stores/app-store.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,10 +1071,12 @@ export class AppStore extends TypedBaseStore<IAppState> {
10711071
}
10721072

10731073
protected emitUpdate() {
1074-
// If the window is hidden then we won't get an animation frame, but there
1075-
// may still be work we wanna do in response to the state change. So
1076-
// immediately emit the update.
1077-
if (this.windowState === 'hidden') {
1074+
// If the window is hidden or not focused then we won't reliably get
1075+
// animation frames (especially on Windows where Chromium throttles
1076+
// requestAnimationFrame for unfocused windows), but there may still be
1077+
// work we wanna do in response to the state change. So immediately emit
1078+
// the update.
1079+
if (this.windowState === 'hidden' || !this.appIsFocused) {
10781080
this.emitUpdateNow()
10791081
return
10801082
}

0 commit comments

Comments
 (0)