Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeekLearnMathWeapp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
frontend
GeekLearnMathWeapp
Commits
245d40da
Commit
245d40da
authored
Jun 20, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
9f004b7c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
battle-complete.tsx
src/pages/game/play/components/battle-complete.tsx
+5
-1
No files found.
src/pages/game/play/components/battle-complete.tsx
View file @
245d40da
...
...
@@ -19,6 +19,7 @@ const BattleComplete = ({ pkResult }: BattleCompleteProps) => {
const
updateState
=
useStoreActions
(
actions
=>
actions
.
mainModel
.
updateState
)
const
setting
=
useStoreState
(
state
=>
state
.
userModel
.
setting
)
const
getSetting
=
useStoreActions
(
actions
=>
actions
.
userModel
.
getSetting
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
upSelf
=
()
=>
{
updateState
({
isCreatePkShow
:
false
,
currentPkStage
:
null
})
...
...
@@ -36,9 +37,12 @@ const BattleComplete = ({ pkResult }: BattleCompleteProps) => {
},
[
pkResult
])
const
isWin
=
useMemo
(()
=>
{
if
(
userInfo
.
userId
&&
userInfo
.
userId
===
pkResult
?.
initiator
)
{
return
pkResult
?.
result
===
'WIN'
}
/** 从发起者角度算 */
return
pkResult
?.
result
===
'LOSE'
},
[
pkResult
])
},
[
pkResult
,
userInfo
])
useEffect
(()
=>
{
if
(
pkResult
)
{
...
...
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