Skip to content

Commit

Permalink
disabled play button while fetching profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Kensaa committed Jan 20, 2024
1 parent 5cb9822 commit cd6325d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion launcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A Minecraft launcher with auto-update feature to facilitate playing modded minecraft",
"author": "Kensa",
"private": true,
"version": "3.2.0",
"version": "3.2.1",
"license": "MIT",
"main": "dist-electron/electron.js",
"scripts": {
Expand Down
14 changes: 12 additions & 2 deletions launcher/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import type { StartArgs } from '../types'
import minecraft from '../img/minecraft.png'
import AlertStack from '../components/AlertStack'
import TaskOverlay from '../components/TaskOverlay'
import { useProfiles, useSelectedProfile } from '../stores/profiles'
import {
useIsFetching,
useProfiles,
useSelectedProfile
} from '../stores/profiles'

export default function Home({
setOverlay,
Expand All @@ -21,6 +25,8 @@ export default function Home({
const connected = useIsConnected()

const profiles = useProfiles()
const fetching = useIsFetching()

const { selectedProfile, setSelectedProfile } = useSelectedProfile()
const [error, setError] = useState('')
const [info, setInfo] = useState('')
Expand Down Expand Up @@ -95,7 +101,11 @@ export default function Home({

<div className='h-25 w-100 d-flex pb-5 justify-content-center align-items-end smooth-background-up position-absolute bottom-0'>
<Button
disabled={!connected || Object.keys(profiles).length === 0}
disabled={
!connected ||
Object.keys(profiles).length === 0 ||
fetching
}
variant='success'
onClick={startGame}
>
Expand Down

0 comments on commit cd6325d

Please sign in to comment.