Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
love_飞影
Neos
Commits
bce465aa
Commit
bce465aa
authored
Apr 09, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: minimal probability of card deck not found
parent
c521af67
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
src/api/deck/deckManager.ts
src/api/deck/deckManager.ts
+2
-1
src/config/defaults.ts
src/config/defaults.ts
+2
-2
src/ui/WaitRoom.tsx
src/ui/WaitRoom.tsx
+0
-1
No files found.
src/api/deck/deckManager.ts
View file @
bce465aa
...
...
@@ -8,7 +8,8 @@ const DECKS: Record<string, { default: IDeck }> = import.meta.glob(
export
const
DeckManager
=
_objToMap
(
Object
.
keys
(
DECKS
).
map
((
key
)
=>
({
...
DECKS
[
key
].
default
,
deckName
:
key
.
split
(
"
/
"
).
pop
()?.
split
(
"
.
"
)[
0
]
??
"
undefined
"
,
deckName
:
key
.
split
(
"
/
"
).
pop
()?.
split
(
"
.
"
).
slice
(
0
,
-
1
).
join
(
"
.
"
)
??
"
undefined
"
,
}))
);
...
...
src/config/defaults.ts
View file @
bce465aa
...
...
@@ -11,14 +11,14 @@ interface DefaultsConfig {
const
defaultConfig
:
DefaultsConfig
=
{
defaultPlayer
:
""
,
// 无需考虑undefined的情况,如果为undefined,界面上会显示【请选择】
defaultDeck
:
VITE_AI_MODE_DEFAULT_DECK
,
defaultDeck
:
""
,
defaultPassword
:
""
,
defaultMora
:
"
scissors
"
,
};
const
aiModeConfig
:
DefaultsConfig
=
{
...
defaultConfig
,
defaultDeck
:
VITE_AI_MODE_DEFAULT_DECK
||
"
Hero
"
,
defaultPlayer
:
`AiKiller
${
Math
.
random
().
toString
(
36
).
slice
(
2
)}
}`
,
defaultPassword
:
"
AI
"
,
};
...
...
src/ui/WaitRoom.tsx
View file @
bce465aa
...
...
@@ -275,7 +275,6 @@ const WaitRoom = () => {
<
Space
wrap
size=
{
16
}
>
<
Select
placeholder=
"请选择卡组"
defaultValue=
{
defaultDeck
}
onChange=
{
handleChoseDeck
}
options=
{
decks
}
style=
{
{
width
:
160
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment