-
Notifications
You must be signed in to change notification settings - Fork 688
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
fix #2431 Progessbar Correct state transition logic #2441
Conversation
@PratyushSingh07 Can you review this..? |
Please resolve the conflicts. |
converting this PR to draft . You can make it ready for review when you solve the error |
@PratyushSingh07 Review this.... |
_recentTransactionUiState.value = | ||
RecentTransactionUiState.LoadMoreRecentTransactions(it.pageItems) | ||
} else if (it.pageItems.isNotEmpty()) { | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you using try block ? catch api doesn't need to work with try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its giving me error to use finally without try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there has to be a better alternative
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or else i will just remove Try and finally set the state at the end to initial (thats works same as finally) what's Your view...?
@PratyushSingh07
} | ||
} finally { | ||
_recentTransactionUiState.value = RecentTransactionUiState.Initial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to use finally here ? This would mean that you would always want to execute this statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PratyushSingh07 Yes...The issue Progress bar is persistent because the state remians in Loading...So we would set the state to intial state again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you certain that the error arises from the viewmodel and not from the fragment ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And after finally @PratyushSingh07
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove random spaces here as well as on line 60
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -28,24 +28,34 @@ class RecentTransactionViewModel @Inject constructor(private val recentTransacti | |||
loadRecentTransactions(offset, limit) | |||
} | |||
|
|||
private fun loadRecentTransactions(offset: Int, limit: Int) { | |||
private fun loadRecentTransactions(offset: Int, limit: Int, refresh: Boolean = false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are you using refresh
variable ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope removing it
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you have spaces here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing..!
Fixes #2431
Please Add Screenshots If there are any UI changes.
Screen_recording_20231105_094122.webm
Please make sure these boxes are checked before submitting your pull request - thanks!
Apply the
AndroidStyle.xml
style template to your code in Android Studio.Run the unit tests with
./gradlew check
to make sure you didn't break anythingIf you have multiple commits please combine them into one commit by squashing them.