1+ import * as Chat2Gen from '../../../actions/chat2-gen'
2+ import * as Constants from '../../../constants/users'
13import * as Container from '../../../util/container'
24import * as RouteTreeGen from '../../../actions/route-tree-gen'
3- import BlockModal , { BlockType , NewBlocksMap , ReportSettings , BlockModalContext } from '.'
4- import * as UsersGen from '../../../actions/users-gen'
55import * as TeamsGen from '../../../actions/teams-gen'
6- import * as Chat2Gen from '../../../actions/chat2 -gen'
7- import * as Constants from '../../../constants/users '
6+ import * as UsersGen from '../../../actions/users -gen'
7+ import BlockModal , { type BlockType , type NewBlocksMap , type ReportSettings } from '.'
88import { leaveTeamWaitingKey } from '../../../constants/teams'
99
10- type OwnProps = Container . RouteProps < {
11- blockUserByDefault ?: boolean
12- context ?: BlockModalContext
13- convID ?: string
14- others ?: Array < string >
15- team ?: string
16- username ?: string
17- } >
10+ type OwnProps = Container . RouteProps < 'chatBlockingModal' >
1811
1912export default Container . connect (
2013 ( state : Container . TypedState , ownProps : OwnProps ) => {
21- const teamname = Container . getRouteProps ( ownProps , ' team' , undefined )
14+ const teamname = ownProps . route . params ?. team ?? undefined
2215 const waitingForLeave = teamname ? Container . anyWaiting ( state , leaveTeamWaitingKey ( teamname ) ) : false
2316 const waitingForBlocking = Container . anyWaiting ( state , Constants . setUserBlocksWaitingKey )
2417 const waitingForReport = Container . anyWaiting ( state , Constants . reportUserWaitingKey )
25- let others = Container . getRouteProps ( ownProps , ' others' , undefined )
26- let adderUsername = Container . getRouteProps ( ownProps , ' username' , undefined )
18+ let others = ownProps . route . params ?. others ?? undefined
19+ let adderUsername = ownProps . route . params ?. username ?? undefined
2720 if ( others ?. length === 1 && ! adderUsername ) {
2821 adderUsername = others [ 0 ]
2922 others = undefined
@@ -32,9 +25,9 @@ export default Container.connect(
3225 return {
3326 _allKnownBlocks : state . users . blockMap ,
3427 adderUsername,
35- blockUserByDefault : Container . getRouteProps ( ownProps , ' blockUserByDefault' , false ) ,
36- context : Container . getRouteProps ( ownProps , ' context' , undefined ) ,
37- convID : Container . getRouteProps ( ownProps , ' convID' , undefined ) ,
28+ blockUserByDefault : ownProps . route . params ?. blockUserByDefault ?? false ,
29+ context : ownProps . route . params ?. context ?? undefined ,
30+ convID : ownProps . route . params ?. convID ?? undefined ,
3831 finishWaiting : waitingForLeave || waitingForBlocking || waitingForReport ,
3932 loadingWaiting : Container . anyWaiting ( state , Constants . getUserBlocksWaitingKey ) ,
4033 otherUsernames : others && others . length > 0 ? others : undefined ,
0 commit comments