Conversation
…e param for iOS non-superuser, move route to root navigator to fix key conflicts, update delete account message and translations
kumulynja
left a comment
There was a problem hiding this comment.
I still see a lot of query parameters use and imo opinion unneccessary fields and conditions to manage the navigation. I think the whole support chat navigation, including the support chat login, can be managed without all of this by just using push instead of go and then you don't need to explicitly navigate back to somewhere, just use default pop back behavior to go back where the user came from.
| queryParameters: | ||
| isIOSNonSuperuser | ||
| ? { | ||
| 'backToWalletHome': | ||
| 'true', | ||
| } | ||
| : {}, |
There was a problem hiding this comment.
Is this really necessarry? The user will never get on the exchange home screen if non superuser in iOS, so the pushNamed to support chat will never be done from here, only from the wallet home or settings.
| if (fromSupport) { | ||
| final isIOSNonSuperuser = Platform.isIOS && | ||
| !(context.read<SettingsCubit>().state.isSuperuser ?? false); | ||
| context.goNamed( | ||
| context.pushNamed( | ||
| ExchangeSupportChatRoute.supportChat.name, | ||
| queryParameters: | ||
| isIOSNonSuperuser ? {} : {'from': 'exchange'}, | ||
| queryParameters: isIOSNonSuperuser | ||
| ? {'backToWalletHome': 'true'} | ||
| : {'from': 'exchange'}, |
There was a problem hiding this comment.
Also here, why is this fromSupport param needed and the from exchange and backToWalletHome parameters? If you just push from screens the user was already allowed to go in, by using normal back behavior, he can never end up on screens he was not allowed to be on. That can only happen if goNamed is used somewhere, but in all of these cases regarding the support login and support chat, it should not be the case. So I feel this is all still too complicated and much of these conditions and queryParameters can just be removed with proper push and back behavior everywhere.
| const ExchangeSupportChatScreen({ | ||
| super.key, | ||
| this.fromExchange = false, | ||
| this.backToWalletHome = false, | ||
| }); | ||
|
|
||
| final bool fromExchange; | ||
| final bool backToWalletHome; |
There was a problem hiding this comment.
Same comment, this all feel like hacks and shouldn't be used if goNamed is not used. Since with push you can not go back to somewhere you don't come from.
Uh oh!
There was an error while loading. Please reload this page.