Skip to content

Commit dfc363f

Browse files
improve logic
1 parent 198c93a commit dfc363f

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

src/frontend/state/GlobalState.tsx

+18-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import {
1010
Runner,
1111
WineVersionInfo,
1212
LibraryTopSectionOptions,
13-
ExperimentalFeatures
13+
ExperimentalFeatures,
14+
Status
1415
} from 'common/types'
1516
import {
1617
DialogModalOptions,
@@ -920,17 +921,27 @@ class GlobalState extends PureComponent<Props> {
920921
storage.setItem('hide_changelogs', JSON.stringify(hideChangelogsOnStartup))
921922
storage.setItem('last_changelog', JSON.stringify(lastChangelogShown))
922923

923-
const pendingOps = libraryStatus.filter(
924-
(game) => game.status !== 'playing' && game.status !== 'done'
925-
).length
924+
const allowedPendingOps: Status[] = [
925+
'installing',
926+
'updating',
927+
'launching',
928+
'playing',
929+
'redist',
930+
'winetricks',
931+
'extracting',
932+
'repairing',
933+
'moving',
934+
'syncing-saves',
935+
'uninstalling'
936+
]
926937

927-
const isPlaying = libraryStatus.filter(
928-
(game) => game.status === 'playing'
938+
const pendingOps = libraryStatus.filter((game) =>
939+
allowedPendingOps.includes(game.status)
929940
).length
930941

931942
if (pendingOps) {
932943
window.api.lock()
933-
} else if (!isPlaying) {
944+
} else {
934945
window.api.unlock()
935946
}
936947
}

0 commit comments

Comments
 (0)