Skip to content

Commit

Permalink
引数を必須にする
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Oct 28, 2024
1 parent c552f9a commit 697507b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/downloadModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,16 @@ export const DownloadModal: React.FC<{
setSelectedOs(os)
// 変更先のOSで選択できないモードの場合、最初のモードを選択する
selectMode(
os,
modeAvailables[os].includes(selectedMode)
? selectedMode
: modeAvailables[os][0],
os
: modeAvailables[os][0]
)
}
const selectMode = (mode: ModeType, os?: OsType) => {
const selectMode = (os: OsType, mode: ModeType) => {
setSelectedMode(mode)
if (!packageAvailables[os ?? selectedOs][mode]!.includes(selectedPackage)) {
setSelectedPackage(packageAvailables[os ?? selectedOs][mode]![0])
if (!packageAvailables[os][mode]!.includes(selectedPackage)) {
setSelectedPackage(packageAvailables[os][mode]![0])
}
}

Expand Down Expand Up @@ -194,7 +194,7 @@ export const DownloadModal: React.FC<{
<DownloadModalSelecter
label="対応モード"
selected={selectedOrDefaultMode}
setSelected={selectMode}
setSelected={mode => selectMode(selectedOs, mode)}
candidates={modeAvailables[selectedOs]}
/>
<p className="has-text-centered is-size-7">
Expand Down

0 comments on commit 697507b

Please sign in to comment.