Skip to content

Commit

Permalink
Update accessCode check in mod dialog & cleanup channel logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyuu-jin committed Jan 7, 2025
1 parent fc25bff commit 1529367
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/frontend/screens/Library/components/InstallModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,9 @@ export default React.memo(function InstallModal({
const [crossoverBottle, setCrossoverBottle] = useState('')
const [accessCode, setAccessCode] = useState('')

const numberOfChannels =
(gameInfo?.channels && Object.keys(gameInfo?.channels).length) ?? 0
const initChannelName =
gameInfo?.channels && numberOfChannels > 0
? Object.keys(gameInfo?.channels)[0]
: 'main'
const channelKeys = Object.keys(gameInfo?.channels || {})
const numberOfChannels = channelKeys.length
const initChannelName = numberOfChannels > 0 ? channelKeys[0] : 'main'
const [channelNameToInstall, setChannelNameToInstall] =
useState(initChannelName)

Expand Down Expand Up @@ -321,7 +318,8 @@ export default React.memo(function InstallModal({
gameInfo={gameInfo}
/>
) : null}
{accessCode && accessCodeContent}
{selectedChannel?.license_config.access_codes &&
accessCodeContent}
</div>
{hasWine ? (
<WineSelector
Expand Down

0 comments on commit 1529367

Please sign in to comment.