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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
MyCard
Neos
Commits
dcd5406e
Commit
dcd5406e
authored
Jan 19, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update checkCardModal slice
parent
1e924955
Pipeline
#19681
passed with stages
in 4 minutes and 21 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
41 deletions
+43
-41
src/reducers/duel/modal/checkCardModalV2Slice.ts
src/reducers/duel/modal/checkCardModalV2Slice.ts
+23
-21
src/reducers/duel/modal/mod.ts
src/reducers/duel/modal/mod.ts
+1
-1
src/service/duel/selectUnselectCard.ts
src/service/duel/selectUnselectCard.ts
+19
-19
No files found.
src/reducers/duel/modal/checkCardModalV2Slice.ts
View file @
dcd5406e
...
@@ -42,22 +42,22 @@ export const setCheckCardModalV2FinishAbleImpl: DuelReducer<boolean> = (
...
@@ -42,22 +42,22 @@ export const setCheckCardModalV2FinishAbleImpl: DuelReducer<boolean> = (
};
};
// 增加卡牌选项
// 增加卡牌选项
export
const
fetchCheckCardMetaV2
=
createAsyncThunk
(
export
const
fetchCheckCardMeta
s
V2
=
createAsyncThunk
(
"
duel/fetchCheckCardMetaV2
"
,
"
duel/fetchCheckCardMetaV2
"
,
async
(
param
:
{
async
(
param
:
{
controler
:
number
;
controler
:
number
;
selected
:
boolean
;
selected
:
boolean
;
option
:
{
code
:
number
;
response
?:
number
}
;
option
s
:
{
code
:
number
;
response
:
number
}[]
;
})
=>
{
})
=>
{
const
meta
=
await
fetchCard
(
param
.
option
.
code
);
const
metas
=
await
Promise
.
all
(
param
.
options
.
map
(
async
(
option
)
=>
{
return
await
fetchCard
(
option
.
code
);
})
);
const
response
=
{
const
response
=
{
controler
:
param
.
controler
,
controler
:
param
.
controler
,
selected
:
param
.
selected
,
selected
:
param
.
selected
,
meta
:
{
metas
,
code
:
meta
.
id
,
name
:
meta
.
text
.
name
,
desc
:
meta
.
text
.
desc
,
},
};
};
return
response
;
return
response
;
...
@@ -67,28 +67,30 @@ export const fetchCheckCardMetaV2 = createAsyncThunk(
...
@@ -67,28 +67,30 @@ export const fetchCheckCardMetaV2 = createAsyncThunk(
export
const
checkCardModalV2Case
=
(
export
const
checkCardModalV2Case
=
(
builder
:
ActionReducerMapBuilder
<
DuelState
>
builder
:
ActionReducerMapBuilder
<
DuelState
>
)
=>
{
)
=>
{
builder
.
addCase
(
fetchCheckCardMetaV2
.
pending
,
(
state
,
action
)
=>
{
builder
.
addCase
(
fetchCheckCardMeta
s
V2
.
pending
,
(
state
,
action
)
=>
{
const
selected
=
action
.
meta
.
arg
.
selected
;
const
selected
=
action
.
meta
.
arg
.
selected
;
const
code
=
action
.
meta
.
arg
.
option
.
code
;
const
options
=
action
.
meta
.
arg
.
options
;
const
response
=
action
.
meta
.
arg
.
option
.
response
;
const
options
=
selected
if
(
selected
)
{
?
state
.
modalState
.
checkCardModalV2
.
selectedOptions
state
.
modalState
.
checkCardModalV2
.
selectedOptions
=
options
;
:
state
.
modalState
.
checkCardModalV2
.
selectableOptions
;
}
else
{
options
.
push
({
code
,
response
});
state
.
modalState
.
checkCardModalV2
.
selectableOptions
=
options
;
}
});
});
builder
.
addCase
(
fetchCheckCardMetaV2
.
fulfilled
,
(
state
,
action
)
=>
{
builder
.
addCase
(
fetchCheckCardMeta
s
V2
.
fulfilled
,
(
state
,
action
)
=>
{
const
selected
=
action
.
payload
.
selected
;
const
selected
=
action
.
payload
.
selected
;
const
meta
=
action
.
payload
.
meta
;
const
meta
s
=
action
.
payload
.
metas
;
const
options
=
selected
const
options
=
selected
?
state
.
modalState
.
checkCardModalV2
.
selectedOptions
?
state
.
modalState
.
checkCardModalV2
.
selectedOptions
:
state
.
modalState
.
checkCardModalV2
.
selectableOptions
;
:
state
.
modalState
.
checkCardModalV2
.
selectableOptions
;
options
.
forEach
((
option
)
=>
{
options
.
forEach
((
option
)
=>
{
if
(
option
.
code
==
meta
.
code
)
{
metas
.
forEach
((
meta
)
=>
{
option
.
name
=
meta
.
name
;
if
(
option
.
code
==
meta
.
id
)
{
option
.
desc
=
meta
.
desc
;
option
.
name
=
meta
.
text
.
name
;
}
option
.
desc
=
meta
.
text
.
desc
;
}
});
});
});
});
});
};
};
...
...
src/reducers/duel/modal/mod.ts
View file @
dcd5406e
...
@@ -69,7 +69,7 @@ export interface ModalState {
...
@@ -69,7 +69,7 @@ export interface ModalState {
code
:
number
;
code
:
number
;
name
?:
string
;
name
?:
string
;
desc
?:
string
;
desc
?:
string
;
response
?
:
number
;
response
:
number
;
}[];
}[];
};
};
}
}
...
...
src/service/duel/selectUnselectCard.ts
View file @
dcd5406e
...
@@ -5,7 +5,7 @@ import {
...
@@ -5,7 +5,7 @@ import {
setCheckCardModalV2IsOpen
,
setCheckCardModalV2IsOpen
,
setCheckCardModalV2MinMax
,
setCheckCardModalV2MinMax
,
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
import
{
fetchCheckCardMetaV2
}
from
"
../../reducers/duel/modal/checkCardModalV2Slice
"
;
import
{
fetchCheckCardMeta
s
V2
}
from
"
../../reducers/duel/modal/checkCardModalV2Slice
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
MsgSelectUnselectCard
=
ygopro
.
StocGameMessage
.
MsgSelectUnselectCard
;
import
MsgSelectUnselectCard
=
ygopro
.
StocGameMessage
.
MsgSelectUnselectCard
;
...
@@ -26,23 +26,23 @@ export default (
...
@@ -26,23 +26,23 @@ export default (
dispatch
(
setCheckCardModalV2CancelAble
(
cancelable
));
dispatch
(
setCheckCardModalV2CancelAble
(
cancelable
));
dispatch
(
setCheckCardModalV2MinMax
({
min
,
max
}));
dispatch
(
setCheckCardModalV2MinMax
({
min
,
max
}));
selectableCards
.
forEach
((
card
)
=>
{
dispatch
(
dispatch
(
fetchCheckCardMetasV2
({
fetchCheckCardMetaV2
({
controler
,
controler
,
selected
:
false
,
selected
:
false
,
options
:
selectableCards
.
map
((
card
)
=>
{
option
:
{
code
:
card
.
code
,
response
:
card
.
response
},
return
{
code
:
card
.
code
,
response
:
card
.
response
};
})
})
,
);
})
}
);
);
selectedCards
.
forEach
((
card
)
=>
{
dispatch
(
dispatch
(
fetchCheckCardMetasV2
({
fetchCheckCardMetaV2
({
controler
,
controler
,
selected
:
true
,
selected
:
true
,
options
:
selectedCards
.
map
((
card
)
=>
{
option
:
{
code
:
card
.
code
},
return
{
code
:
card
.
code
,
response
:
card
.
response
};
})
})
,
);
})
}
);
);
};
};
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