Skip to content

Commit

Permalink
Merge 822e55e into 7f31c5b
Browse files Browse the repository at this point in the history
  • Loading branch information
arquelion authored Oct 7, 2024
2 parents 7f31c5b + 822e55e commit 7cfdce1
Show file tree
Hide file tree
Showing 5 changed files with 521 additions and 714 deletions.
4 changes: 2 additions & 2 deletions libs/gi/page-characters/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
CharacterCard,
CharacterEditor,
CharacterRarityToggle,
CharacterSelectionModal,
CharacterSingleSelectionModal,
ElementToggle,
SillyContext,
WeaponToggle,
Expand Down Expand Up @@ -222,7 +222,7 @@ export default function PageCharacter() {
/>
)}
<Suspense fallback={false}>
<CharacterSelectionModal
<CharacterSingleSelectionModal
newFirst
show={newCharacter}
onHide={() => setnewCharacter(false)}
Expand Down
15 changes: 7 additions & 8 deletions libs/gi/page-team/src/TeamSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
CharIconSide,
CharacterMultiSelectionModal,
CharacterName,
CharacterSelectionModal,
CharacterSingleSelectionModal,
EnemyExpandCard,
TeamDelModal,
TeamInfoAlert,
Expand Down Expand Up @@ -116,6 +116,7 @@ function TeamEditor({
const database = useDatabase()
const team = database.teams.get(teamId)!
const { loadoutData } = team

const onSelect = (cKey: CharacterKey, selectedIndex: number) => {
// Make sure character exists
database.chars.getWithInitWeapon(cKey)
Expand Down Expand Up @@ -170,9 +171,6 @@ function TeamEditor({
const [charSelectIndex, setCharSelectIndex] = useState(
undefined as number | undefined
)
const charKeyAtIndex = database.teamChars.get(
loadoutData[charSelectIndex as number]?.teamCharId
)?.key
const onSingleSelect = (cKey: CharacterKey) => {
if (charSelectIndex === undefined) return
onSelect(cKey, charSelectIndex)
Expand Down Expand Up @@ -215,11 +213,12 @@ function TeamEditor({
return (
<>
<Suspense fallback={false}>
<CharacterSelectionModal
filter={(c) => c !== charKeyAtIndex}
<CharacterSingleSelectionModal
show={!showMultiSelect && charSelectIndex !== undefined}
onHide={() => setCharSelectIndex(undefined)}
onSelect={onSingleSelect}
selectedIndex={charSelectIndex}
loadoutData={loadoutData}
/>
</Suspense>
<Suspense fallback={false}>
Expand All @@ -228,8 +227,8 @@ function TeamEditor({
onHide={() => {
setShowMultiSelect(false)
}}
onMultiSelect={onMultiSelect}
teamId={teamId}
onSelect={onMultiSelect}
loadoutData={loadoutData}
/>
</Suspense>
<Grid container columns={{ xs: 1, md: 2 }} spacing={2}>
Expand Down
Loading

0 comments on commit 7cfdce1

Please sign in to comment.