Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOB-365 Bump Abacus and update the system link #36

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion v4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ext {
compileSdkVersion = 34

// App dependencies
abacusVersion = '1.6.1'
abacusVersion = '1.6.10'
carteraVersion = '0.1.12'
kollectionsVersion = '2.0.16'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ class DydxSystemStatusViewModel @Inject constructor(

init {
router.navigateBack()
abacusStateManager.environment?.links?.community.let { communityLink ->
if (communityLink != null) {
router.navigateTo(communityLink)
}
val url = abacusStateManager.environment?.links?.statusPage ?: abacusStateManager.environment?.links?.community
if (url != null) {
router.navigateTo(url)
Comment on lines 21 to +24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems very strange, why are we doing navigation in init { }? What's the context here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why even have this ViewModel at all - can just route to the link from the previous page right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to maintain the same coding pattern for all setting items, and we have a generic routing logic for all settings.

Settings.json contains the link that route the app to a view, of which the view model determines what to show. In this case, we just want to route the user to an external URL (of the selected environment).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't we just update the generic logic to handle external urls (or at the very least http/https)? this is super hacky

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or rather, you could explicitly handle this specific route ("settings/status") in the settings viewmodel

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generic router already handles http/https, but in this case we need additional logic to determine the http address.

On both iOS and Android, we have the same pattern of having the router routes to different handlers for custom logic. Agreed that on Android it's a bit hacky to have the view/viewModel as handlers for viewless logic. We can refactor this in the future.

}
}

Expand Down
Loading