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

fix #2431 Progessbar Correct state transition logic #2441

Closed
wants to merge 1 commit into from
Closed

fix #2431 Progessbar Correct state transition logic #2441

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 17, 2023

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 anything

  • If you have multiple commits please combine them into one commit by squashing them.

@ghost
Copy link
Author

ghost commented Dec 6, 2023

@PratyushSingh07 Can you review this..?

@therajanmaurya
Copy link
Member

Please resolve the conflicts.

@ghost ghost closed this Dec 30, 2023
@ghost ghost deleted the bugfix branch December 30, 2023 14:12
@ghost ghost restored the bugfix branch December 31, 2023 15:41
@ghost ghost reopened this Dec 31, 2023
@PratyushSingh07
Copy link
Collaborator

converting this PR to draft . You can make it ready for review when you solve the error

@PratyushSingh07 PratyushSingh07 marked this pull request as draft January 2, 2024 16:35
@ghost ghost marked this pull request as ready for review January 4, 2024 18:24
@ghost
Copy link
Author

ghost commented Jan 4, 2024

@PratyushSingh07 Review this....

_recentTransactionUiState.value =
RecentTransactionUiState.LoadMoreRecentTransactions(it.pageItems)
} else if (it.pageItems.isNotEmpty()) {
try {
Copy link
Collaborator

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

Copy link
Author

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

Copy link
Collaborator

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

Copy link
Author

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
Copy link
Collaborator

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

Copy link
Author

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

Copy link
Collaborator

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 ?

Copy link
Author

Choose a reason for hiding this comment

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

Yes! here are the log statements before finally..!
Screenshot 2024-01-05 180450

Copy link
Author

Choose a reason for hiding this comment

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

And after finally @PratyushSingh07
Screenshot 2024-01-05 180214

}

Copy link
Collaborator

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

Copy link
Author

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) {
Copy link
Collaborator

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 ?

Copy link
Author

Choose a reason for hiding this comment

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

Nope removing it

Comment on lines +111 to +113



Copy link
Collaborator

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 ?

Copy link
Author

Choose a reason for hiding this comment

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

Removing..!

@PratyushSingh07 PratyushSingh07 marked this pull request as draft January 4, 2024 18:48
@ghost ghost closed this by deleting the head repository May 4, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Persistent progress bar in recent transaction
3 participants